
obj/kern/kernel:     file format elf32-i386

Disassembly of section .text:

f0100000 <_start-0xc>:
.long MULTIBOOT_HEADER_FLAGS
.long CHECKSUM

.globl		_start
_start:
	movw	$0x1234,0x472			# warm boot
f0100000:	02 b0 ad 1b 03 00    	add    0x31bad(%eax),%dh
f0100006:	00 00                	add    %al,(%eax)
f0100008:	fb                   	sti    
f0100009:	4f                   	dec    %edi
f010000a:	52                   	push   %edx
f010000b:	e4 66                	in     $0x66,%al

f010000c <_start>:
f010000c:	66 c7 05 72 04 00 00 	movw   $0x1234,0x472
f0100013:	34 12 

	# Establish our own GDT in place of the boot loader's temporary GDT.
	lgdt	RELOC(mygdtdesc)		# load descriptor table
f0100015:	0f 01 15 18 30 11 00 	lgdtl  0x113018

	# Immediately reload all segment registers (including CS!)
	# with segment selectors from the new GDT.
	movl	$DATA_SEL,%eax			# Data segment selector
f010001c:	b8 10 00 00 00       	mov    $0x10,%eax
	movw	%ax,%ds				# -> DS: Data Segment
f0100021:	8e d8                	mov    %eax,%ds
	movw	%ax,%es				# -> ES: Extra Segment
f0100023:	8e c0                	mov    %eax,%es
	movw	%ax,%ss				# -> SS: Stack Segment
f0100025:	8e d0                	mov    %eax,%ss
	ljmp	$CODE_SEL,$relocated		# reload CS by jumping
f0100027:	ea 2e 00 10 f0 08 00 	ljmp   $0x8,$0xf010002e

f010002e <relocated>:
relocated:

	# Clear the frame pointer register (EBP)
	# so that once we get into debugging C code,
	# stack backtraces will be terminated properly.
	movl	$0x0,%ebp			# nuke frame pointer
f010002e:	bd 00 00 00 00       	mov    $0x0,%ebp

        # Set the stack pointer
	movl	$(bootstacktop),%esp
f0100033:	bc 00 30 11 f0       	mov    $0xf0113000,%esp

	# now to C code
	call	i386_init
f0100038:	e8 63 00 00 00       	call   f01000a0 <i386_init>

f010003d <spin>:

	# Should never get here, but in case we do, just spin.
spin:	jmp	spin
f010003d:	eb fe                	jmp    f010003d <spin>
	...

f0100040 <test_backtrace>:
#include <kern/pmap.h>
#include <kern/kclock.h>

void
test_backtrace(int x)
{
f0100040:	55                   	push   %ebp
f0100041:	89 e5                	mov    %esp,%ebp
f0100043:	83 ec 18             	sub    $0x18,%esp
        cprintf("entering test_backtrace %d\n", x);
f0100046:	8b 45 08             	mov    0x8(%ebp),%eax
f0100049:	89 44 24 04          	mov    %eax,0x4(%esp)
f010004d:	c7 04 24 40 38 10 f0 	movl   $0xf0103840,(%esp)
f0100054:	e8 0e 24 00 00       	call   f0102467 <cprintf>
        if (x > 0)
f0100059:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
f010005d:	7e 10                	jle    f010006f <test_backtrace+0x2f>
                test_backtrace(x-1);
f010005f:	8b 45 08             	mov    0x8(%ebp),%eax
f0100062:	83 e8 01             	sub    $0x1,%eax
f0100065:	89 04 24             	mov    %eax,(%esp)
f0100068:	e8 d3 ff ff ff       	call   f0100040 <test_backtrace>
f010006d:	eb 1c                	jmp    f010008b <test_backtrace+0x4b>
        else
                mon_backtrace(0, 0, 0);
f010006f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
f0100076:	00 
f0100077:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f010007e:	00 
f010007f:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
f0100086:	e8 08 0a 00 00       	call   f0100a93 <mon_backtrace>
        cprintf("leaving test_backtrace %d\n", x);
f010008b:	8b 45 08             	mov    0x8(%ebp),%eax
f010008e:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100092:	c7 04 24 5c 38 10 f0 	movl   $0xf010385c,(%esp)
f0100099:	e8 c9 23 00 00       	call   f0102467 <cprintf>
}
f010009e:	c9                   	leave  
f010009f:	c3                   	ret    

f01000a0 <i386_init>:

void
i386_init(void)
{
f01000a0:	55                   	push   %ebp
f01000a1:	89 e5                	mov    %esp,%ebp
f01000a3:	83 ec 18             	sub    $0x18,%esp
	extern char edata[], end[];

	// Before doing anything else,
	// clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);
f01000a6:	ba 30 3c 11 f0       	mov    $0xf0113c30,%edx
f01000ab:	b8 b8 35 11 f0       	mov    $0xf01135b8,%eax
f01000b0:	89 d1                	mov    %edx,%ecx
f01000b2:	29 c1                	sub    %eax,%ecx
f01000b4:	89 c8                	mov    %ecx,%eax
f01000b6:	89 44 24 08          	mov    %eax,0x8(%esp)
f01000ba:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f01000c1:	00 
f01000c2:	c7 04 24 b8 35 11 f0 	movl   $0xf01135b8,(%esp)
f01000c9:	e8 c2 31 00 00       	call   f0103290 <memset>

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();
f01000ce:	e8 49 08 00 00       	call   f010091c <cons_init>

	cprintf("240 decimal is %o octal!\n", 240);
f01000d3:	c7 44 24 04 f0 00 00 	movl   $0xf0,0x4(%esp)
f01000da:	00 
f01000db:	c7 04 24 77 38 10 f0 	movl   $0xf0103877,(%esp)
f01000e2:	e8 80 23 00 00       	call   f0102467 <cprintf>

        test_backtrace(5);
f01000e7:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
f01000ee:	e8 4d ff ff ff       	call   f0100040 <test_backtrace>

	// Lab 2 memory management initialization functions
	i386_detect_memory();
f01000f3:	e8 2d 0c 00 00       	call   f0100d25 <i386_detect_memory>
	i386_vm_init();
f01000f8:	e8 dd 0e 00 00       	call   f0100fda <i386_vm_init>
	page_init();
f01000fd:	e8 4a 15 00 00       	call   f010164c <page_init>
	page_check();
f0100102:	e8 61 18 00 00       	call   f0101968 <page_check>



	// Drop into the kernel monitor.
	while (1)
		monitor(NULL);
f0100107:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
f010010e:	e8 88 0b 00 00       	call   f0100c9b <monitor>
f0100113:	eb f2                	jmp    f0100107 <i386_init+0x67>

f0100115 <_panic>:
 * Panic is called on unresolvable fatal errors.
 * It prints "panic: mesg", and then enters the kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt,...)
{
f0100115:	55                   	push   %ebp
f0100116:	89 e5                	mov    %esp,%ebp
f0100118:	83 ec 28             	sub    $0x28,%esp
	va_list ap;

	if (panicstr)
f010011b:	a1 c0 35 11 f0       	mov    0xf01135c0,%eax
f0100120:	85 c0                	test   %eax,%eax
f0100122:	75 49                	jne    f010016d <_panic+0x58>
		goto dead;
	panicstr = fmt;
f0100124:	8b 45 10             	mov    0x10(%ebp),%eax
f0100127:	a3 c0 35 11 f0       	mov    %eax,0xf01135c0

	va_start(ap, fmt);
f010012c:	8d 45 10             	lea    0x10(%ebp),%eax
f010012f:	83 c0 04             	add    $0x4,%eax
f0100132:	89 45 fc             	mov    %eax,-0x4(%ebp)
	cprintf("kernel panic at %s:%d: ", file, line);
f0100135:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100138:	89 44 24 08          	mov    %eax,0x8(%esp)
f010013c:	8b 45 08             	mov    0x8(%ebp),%eax
f010013f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100143:	c7 04 24 91 38 10 f0 	movl   $0xf0103891,(%esp)
f010014a:	e8 18 23 00 00       	call   f0102467 <cprintf>
	vcprintf(fmt, ap);
f010014f:	8b 55 10             	mov    0x10(%ebp),%edx
f0100152:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100155:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100159:	89 14 24             	mov    %edx,(%esp)
f010015c:	e8 d2 22 00 00       	call   f0102433 <vcprintf>
	cprintf("\n");
f0100161:	c7 04 24 a9 38 10 f0 	movl   $0xf01038a9,(%esp)
f0100168:	e8 fa 22 00 00       	call   f0102467 <cprintf>
	va_end(ap);

dead:
	/* break into the kernel monitor */
	while (1)
		monitor(NULL);
f010016d:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
f0100174:	e8 22 0b 00 00       	call   f0100c9b <monitor>
f0100179:	eb f2                	jmp    f010016d <_panic+0x58>

f010017b <_warn>:
}

/* like panic, but don't */
void
_warn(const char *file, int line, const char *fmt,...)
{
f010017b:	55                   	push   %ebp
f010017c:	89 e5                	mov    %esp,%ebp
f010017e:	83 ec 28             	sub    $0x28,%esp
	va_list ap;

	va_start(ap, fmt);
f0100181:	8d 45 10             	lea    0x10(%ebp),%eax
f0100184:	83 c0 04             	add    $0x4,%eax
f0100187:	89 45 fc             	mov    %eax,-0x4(%ebp)
	cprintf("kernel warning at %s:%d: ", file, line);
f010018a:	8b 45 0c             	mov    0xc(%ebp),%eax
f010018d:	89 44 24 08          	mov    %eax,0x8(%esp)
f0100191:	8b 45 08             	mov    0x8(%ebp),%eax
f0100194:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100198:	c7 04 24 ab 38 10 f0 	movl   $0xf01038ab,(%esp)
f010019f:	e8 c3 22 00 00       	call   f0102467 <cprintf>
	vcprintf(fmt, ap);
f01001a4:	8b 55 10             	mov    0x10(%ebp),%edx
f01001a7:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01001aa:	89 44 24 04          	mov    %eax,0x4(%esp)
f01001ae:	89 14 24             	mov    %edx,(%esp)
f01001b1:	e8 7d 22 00 00       	call   f0102433 <vcprintf>
	cprintf("\n");
f01001b6:	c7 04 24 a9 38 10 f0 	movl   $0xf01038a9,(%esp)
f01001bd:	e8 a5 22 00 00       	call   f0102467 <cprintf>
	va_end(ap);
}
f01001c2:	c9                   	leave  
f01001c3:	c3                   	ret    

f01001c4 <serial_proc_data>:

static bool serial_exists;

int
serial_proc_data(void)
{
f01001c4:	55                   	push   %ebp
f01001c5:	89 e5                	mov    %esp,%ebp
f01001c7:	83 ec 14             	sub    $0x14,%esp
f01001ca:	c7 45 f0 fd 03 00 00 	movl   $0x3fd,-0x10(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01001d1:	8b 55 f0             	mov    -0x10(%ebp),%edx
f01001d4:	ec                   	in     (%dx),%al
f01001d5:	88 45 f7             	mov    %al,-0x9(%ebp)
	return data;
f01001d8:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
	if (!(inb(COM1+COM_LSR) & COM_LSR_DATA))
f01001dc:	0f b6 c0             	movzbl %al,%eax
f01001df:	83 e0 01             	and    $0x1,%eax
f01001e2:	85 c0                	test   %eax,%eax
f01001e4:	75 09                	jne    f01001ef <serial_proc_data+0x2b>
		return -1;
f01001e6:	c7 45 ec ff ff ff ff 	movl   $0xffffffff,-0x14(%ebp)
f01001ed:	eb 18                	jmp    f0100207 <serial_proc_data+0x43>
f01001ef:	c7 45 f8 f8 03 00 00 	movl   $0x3f8,-0x8(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01001f6:	8b 55 f8             	mov    -0x8(%ebp),%edx
f01001f9:	ec                   	in     (%dx),%al
f01001fa:	88 45 ff             	mov    %al,-0x1(%ebp)
	return data;
f01001fd:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax
	return inb(COM1+COM_RX);
f0100201:	0f b6 c0             	movzbl %al,%eax
f0100204:	89 45 ec             	mov    %eax,-0x14(%ebp)
f0100207:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f010020a:	c9                   	leave  
f010020b:	c3                   	ret    

f010020c <serial_intr>:

void
serial_intr(void)
{
f010020c:	55                   	push   %ebp
f010020d:	89 e5                	mov    %esp,%ebp
f010020f:	83 ec 08             	sub    $0x8,%esp
	if (serial_exists)
f0100212:	a1 e4 35 11 f0       	mov    0xf01135e4,%eax
f0100217:	85 c0                	test   %eax,%eax
f0100219:	74 0c                	je     f0100227 <serial_intr+0x1b>
		cons_intr(serial_proc_data);
f010021b:	c7 04 24 c4 01 10 f0 	movl   $0xf01001c4,(%esp)
f0100222:	e8 28 06 00 00       	call   f010084f <cons_intr>
}
f0100227:	c9                   	leave  
f0100228:	c3                   	ret    

f0100229 <serial_init>:

void
serial_init(void)
{
f0100229:	55                   	push   %ebp
f010022a:	89 e5                	mov    %esp,%ebp
f010022c:	83 ec 50             	sub    $0x50,%esp
f010022f:	c7 45 b4 fa 03 00 00 	movl   $0x3fa,-0x4c(%ebp)
f0100236:	c6 45 b3 00          	movb   $0x0,-0x4d(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f010023a:	0f b6 45 b3          	movzbl -0x4d(%ebp),%eax
f010023e:	8b 55 b4             	mov    -0x4c(%ebp),%edx
f0100241:	ee                   	out    %al,(%dx)
f0100242:	c7 45 bc fb 03 00 00 	movl   $0x3fb,-0x44(%ebp)
f0100249:	c6 45 bb 80          	movb   $0x80,-0x45(%ebp)
f010024d:	0f b6 45 bb          	movzbl -0x45(%ebp),%eax
f0100251:	8b 55 bc             	mov    -0x44(%ebp),%edx
f0100254:	ee                   	out    %al,(%dx)
f0100255:	c7 45 c4 f8 03 00 00 	movl   $0x3f8,-0x3c(%ebp)
f010025c:	c6 45 c3 0c          	movb   $0xc,-0x3d(%ebp)
f0100260:	0f b6 45 c3          	movzbl -0x3d(%ebp),%eax
f0100264:	8b 55 c4             	mov    -0x3c(%ebp),%edx
f0100267:	ee                   	out    %al,(%dx)
f0100268:	c7 45 cc f9 03 00 00 	movl   $0x3f9,-0x34(%ebp)
f010026f:	c6 45 cb 00          	movb   $0x0,-0x35(%ebp)
f0100273:	0f b6 45 cb          	movzbl -0x35(%ebp),%eax
f0100277:	8b 55 cc             	mov    -0x34(%ebp),%edx
f010027a:	ee                   	out    %al,(%dx)
f010027b:	c7 45 d4 fb 03 00 00 	movl   $0x3fb,-0x2c(%ebp)
f0100282:	c6 45 d3 03          	movb   $0x3,-0x2d(%ebp)
f0100286:	0f b6 45 d3          	movzbl -0x2d(%ebp),%eax
f010028a:	8b 55 d4             	mov    -0x2c(%ebp),%edx
f010028d:	ee                   	out    %al,(%dx)
f010028e:	c7 45 dc fc 03 00 00 	movl   $0x3fc,-0x24(%ebp)
f0100295:	c6 45 db 00          	movb   $0x0,-0x25(%ebp)
f0100299:	0f b6 45 db          	movzbl -0x25(%ebp),%eax
f010029d:	8b 55 dc             	mov    -0x24(%ebp),%edx
f01002a0:	ee                   	out    %al,(%dx)
f01002a1:	c7 45 e4 f9 03 00 00 	movl   $0x3f9,-0x1c(%ebp)
f01002a8:	c6 45 e3 01          	movb   $0x1,-0x1d(%ebp)
f01002ac:	0f b6 45 e3          	movzbl -0x1d(%ebp),%eax
f01002b0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
f01002b3:	ee                   	out    %al,(%dx)
f01002b4:	c7 45 e8 fd 03 00 00 	movl   $0x3fd,-0x18(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01002bb:	8b 55 e8             	mov    -0x18(%ebp),%edx
f01002be:	ec                   	in     (%dx),%al
f01002bf:	88 45 ef             	mov    %al,-0x11(%ebp)
	return data;
f01002c2:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
	// Enable rcv interrupts
	outb(COM1+COM_IER, COM_IER_RDI);

	// Clear any preexisting overrun indications and interrupts
	// Serial port doesn't exist if COM_LSR returns 0xFF
	serial_exists = (inb(COM1+COM_LSR) != 0xFF);
f01002c6:	3c ff                	cmp    $0xff,%al
f01002c8:	0f 95 c0             	setne  %al
f01002cb:	0f b6 c0             	movzbl %al,%eax
f01002ce:	a3 e4 35 11 f0       	mov    %eax,0xf01135e4
f01002d3:	c7 45 f0 fa 03 00 00 	movl   $0x3fa,-0x10(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01002da:	8b 55 f0             	mov    -0x10(%ebp),%edx
f01002dd:	ec                   	in     (%dx),%al
f01002de:	88 45 f7             	mov    %al,-0x9(%ebp)
	return data;
f01002e1:	c7 45 f8 f8 03 00 00 	movl   $0x3f8,-0x8(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01002e8:	8b 55 f8             	mov    -0x8(%ebp),%edx
f01002eb:	ec                   	in     (%dx),%al
f01002ec:	88 45 ff             	mov    %al,-0x1(%ebp)
	(void) inb(COM1+COM_IIR);
	(void) inb(COM1+COM_RX);

}
f01002ef:	c9                   	leave  
f01002f0:	c3                   	ret    

f01002f1 <delay>:
// page.

// Stupid I/O delay routine necessitated by historical PC design flaws
static void
delay(void)
{
f01002f1:	55                   	push   %ebp
f01002f2:	89 e5                	mov    %esp,%ebp
f01002f4:	83 ec 20             	sub    $0x20,%esp
f01002f7:	c7 45 e0 84 00 00 00 	movl   $0x84,-0x20(%ebp)
f01002fe:	8b 55 e0             	mov    -0x20(%ebp),%edx
f0100301:	ec                   	in     (%dx),%al
f0100302:	88 45 e7             	mov    %al,-0x19(%ebp)
	return data;
f0100305:	c7 45 e8 84 00 00 00 	movl   $0x84,-0x18(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010030c:	8b 55 e8             	mov    -0x18(%ebp),%edx
f010030f:	ec                   	in     (%dx),%al
f0100310:	88 45 ef             	mov    %al,-0x11(%ebp)
	return data;
f0100313:	c7 45 f0 84 00 00 00 	movl   $0x84,-0x10(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010031a:	8b 55 f0             	mov    -0x10(%ebp),%edx
f010031d:	ec                   	in     (%dx),%al
f010031e:	88 45 f7             	mov    %al,-0x9(%ebp)
	return data;
f0100321:	c7 45 f8 84 00 00 00 	movl   $0x84,-0x8(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f0100328:	8b 55 f8             	mov    -0x8(%ebp),%edx
f010032b:	ec                   	in     (%dx),%al
f010032c:	88 45 ff             	mov    %al,-0x1(%ebp)
	inb(0x84);
	inb(0x84);
	inb(0x84);
	inb(0x84);
}
f010032f:	c9                   	leave  
f0100330:	c3                   	ret    

f0100331 <lpt_putc>:

static void
lpt_putc(int c)
{
f0100331:	55                   	push   %ebp
f0100332:	89 e5                	mov    %esp,%ebp
f0100334:	83 ec 20             	sub    $0x20,%esp
	int i;

	for (i = 0; !(inb(0x378+1) & 0x80) && i < 12800; i++)
f0100337:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
f010033e:	eb 09                	jmp    f0100349 <lpt_putc+0x18>
		delay();
f0100340:	e8 ac ff ff ff       	call   f01002f1 <delay>
static void
lpt_putc(int c)
{
	int i;

	for (i = 0; !(inb(0x378+1) & 0x80) && i < 12800; i++)
f0100345:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
f0100349:	c7 45 e4 79 03 00 00 	movl   $0x379,-0x1c(%ebp)
f0100350:	8b 55 e4             	mov    -0x1c(%ebp),%edx
f0100353:	ec                   	in     (%dx),%al
f0100354:	88 45 ea             	mov    %al,-0x16(%ebp)
	return data;
f0100357:	0f b6 45 ea          	movzbl -0x16(%ebp),%eax
f010035b:	84 c0                	test   %al,%al
f010035d:	78 09                	js     f0100368 <lpt_putc+0x37>
f010035f:	81 7d e0 ff 31 00 00 	cmpl   $0x31ff,-0x20(%ebp)
f0100366:	7e d8                	jle    f0100340 <lpt_putc+0xf>
		delay();
	outb(0x378+0, c);
f0100368:	8b 45 08             	mov    0x8(%ebp),%eax
f010036b:	0f b6 c0             	movzbl %al,%eax
f010036e:	c7 45 ec 78 03 00 00 	movl   $0x378,-0x14(%ebp)
f0100375:	88 45 eb             	mov    %al,-0x15(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100378:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f010037c:	8b 55 ec             	mov    -0x14(%ebp),%edx
f010037f:	ee                   	out    %al,(%dx)
f0100380:	c7 45 f4 7a 03 00 00 	movl   $0x37a,-0xc(%ebp)
f0100387:	c6 45 f3 0d          	movb   $0xd,-0xd(%ebp)
f010038b:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
f010038f:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0100392:	ee                   	out    %al,(%dx)
f0100393:	c7 45 fc 7a 03 00 00 	movl   $0x37a,-0x4(%ebp)
f010039a:	c6 45 fb 08          	movb   $0x8,-0x5(%ebp)
f010039e:	0f b6 45 fb          	movzbl -0x5(%ebp),%eax
f01003a2:	8b 55 fc             	mov    -0x4(%ebp),%edx
f01003a5:	ee                   	out    %al,(%dx)
	outb(0x378+2, 0x08|0x04|0x01);
	outb(0x378+2, 0x08);
}
f01003a6:	c9                   	leave  
f01003a7:	c3                   	ret    

f01003a8 <cga_init>:
static uint16_t *crt_buf;
static uint16_t crt_pos;

void
cga_init(void)
{
f01003a8:	55                   	push   %ebp
f01003a9:	89 e5                	mov    %esp,%ebp
f01003ab:	83 ec 30             	sub    $0x30,%esp
	volatile uint16_t *cp;
	uint16_t was;
	unsigned pos;

	cp = (uint16_t*) (KERNBASE + CGA_BUF);
f01003ae:	c7 45 d8 00 80 0b f0 	movl   $0xf00b8000,-0x28(%ebp)
	was = *cp;
f01003b5:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01003b8:	0f b7 00             	movzwl (%eax),%eax
f01003bb:	66 89 45 de          	mov    %ax,-0x22(%ebp)
	*cp = (uint16_t) 0xA55A;
f01003bf:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01003c2:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
	if (*cp != 0xA55A) {
f01003c7:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01003ca:	0f b7 00             	movzwl (%eax),%eax
f01003cd:	66 3d 5a a5          	cmp    $0xa55a,%ax
f01003d1:	74 13                	je     f01003e6 <cga_init+0x3e>
		cp = (uint16_t*) (KERNBASE + MONO_BUF);
f01003d3:	c7 45 d8 00 00 0b f0 	movl   $0xf00b0000,-0x28(%ebp)
		addr_6845 = MONO_BASE;
f01003da:	c7 05 e8 35 11 f0 b4 	movl   $0x3b4,0xf01135e8
f01003e1:	03 00 00 
f01003e4:	eb 14                	jmp    f01003fa <cga_init+0x52>
	} else {
		*cp = was;
f01003e6:	8b 55 d8             	mov    -0x28(%ebp),%edx
f01003e9:	0f b7 45 de          	movzwl -0x22(%ebp),%eax
f01003ed:	66 89 02             	mov    %ax,(%edx)
		addr_6845 = CGA_BASE;
f01003f0:	c7 05 e8 35 11 f0 d4 	movl   $0x3d4,0xf01135e8
f01003f7:	03 00 00 
	}
	
	/* Extract cursor location */
	outb(addr_6845, 14);
f01003fa:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f01003ff:	89 45 e8             	mov    %eax,-0x18(%ebp)
f0100402:	c6 45 e7 0e          	movb   $0xe,-0x19(%ebp)
f0100406:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
f010040a:	8b 55 e8             	mov    -0x18(%ebp),%edx
f010040d:	ee                   	out    %al,(%dx)
	pos = inb(addr_6845 + 1) << 8;
f010040e:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f0100413:	83 c0 01             	add    $0x1,%eax
f0100416:	89 45 ec             	mov    %eax,-0x14(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f0100419:	8b 55 ec             	mov    -0x14(%ebp),%edx
f010041c:	ec                   	in     (%dx),%al
f010041d:	88 45 f2             	mov    %al,-0xe(%ebp)
	return data;
f0100420:	0f b6 45 f2          	movzbl -0xe(%ebp),%eax
f0100424:	0f b6 c0             	movzbl %al,%eax
f0100427:	c1 e0 08             	shl    $0x8,%eax
f010042a:	89 45 e0             	mov    %eax,-0x20(%ebp)
	outb(addr_6845, 15);
f010042d:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f0100432:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0100435:	c6 45 f3 0f          	movb   $0xf,-0xd(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100439:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
f010043d:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0100440:	ee                   	out    %al,(%dx)
	pos |= inb(addr_6845 + 1);
f0100441:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f0100446:	83 c0 01             	add    $0x1,%eax
f0100449:	89 45 f8             	mov    %eax,-0x8(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010044c:	8b 55 f8             	mov    -0x8(%ebp),%edx
f010044f:	ec                   	in     (%dx),%al
f0100450:	88 45 ff             	mov    %al,-0x1(%ebp)
	return data;
f0100453:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax
f0100457:	0f b6 c0             	movzbl %al,%eax
f010045a:	09 45 e0             	or     %eax,-0x20(%ebp)

	crt_buf = (uint16_t*) cp;
f010045d:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0100460:	a3 ec 35 11 f0       	mov    %eax,0xf01135ec
	crt_pos = pos;
f0100465:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0100468:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
}
f010046e:	c9                   	leave  
f010046f:	c3                   	ret    

f0100470 <cga_putc>:



void
cga_putc(int c)
{
f0100470:	55                   	push   %ebp
f0100471:	89 e5                	mov    %esp,%ebp
f0100473:	53                   	push   %ebx
f0100474:	83 ec 44             	sub    $0x44,%esp
	// if no attribute given, then use black on white
	if (!(c & ~0xFF))
f0100477:	8b 45 08             	mov    0x8(%ebp),%eax
f010047a:	b0 00                	mov    $0x0,%al
f010047c:	85 c0                	test   %eax,%eax
f010047e:	75 07                	jne    f0100487 <cga_putc+0x17>
		c |= 0x0700;
f0100480:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)

	switch (c & 0xff) {
f0100487:	8b 45 08             	mov    0x8(%ebp),%eax
f010048a:	25 ff 00 00 00       	and    $0xff,%eax
f010048f:	89 45 c4             	mov    %eax,-0x3c(%ebp)
f0100492:	83 7d c4 09          	cmpl   $0x9,-0x3c(%ebp)
f0100496:	0f 84 bf 00 00 00    	je     f010055b <cga_putc+0xeb>
f010049c:	83 7d c4 09          	cmpl   $0x9,-0x3c(%ebp)
f01004a0:	7f 0b                	jg     f01004ad <cga_putc+0x3d>
f01004a2:	83 7d c4 08          	cmpl   $0x8,-0x3c(%ebp)
f01004a6:	74 16                	je     f01004be <cga_putc+0x4e>
f01004a8:	e9 ec 00 00 00       	jmp    f0100599 <cga_putc+0x129>
f01004ad:	83 7d c4 0a          	cmpl   $0xa,-0x3c(%ebp)
f01004b1:	74 4f                	je     f0100502 <cga_putc+0x92>
f01004b3:	83 7d c4 0d          	cmpl   $0xd,-0x3c(%ebp)
f01004b7:	74 59                	je     f0100512 <cga_putc+0xa2>
f01004b9:	e9 db 00 00 00       	jmp    f0100599 <cga_putc+0x129>
	case '\b':
		if (crt_pos > 0) {
f01004be:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f01004c5:	66 85 c0             	test   %ax,%ax
f01004c8:	0f 84 ee 00 00 00    	je     f01005bc <cga_putc+0x14c>
			crt_pos--;
f01004ce:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f01004d5:	83 e8 01             	sub    $0x1,%eax
f01004d8:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
			crt_buf[crt_pos] = (c & ~0xff) | ' ';
f01004de:	8b 15 ec 35 11 f0    	mov    0xf01135ec,%edx
f01004e4:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f01004eb:	0f b7 c0             	movzwl %ax,%eax
f01004ee:	01 c0                	add    %eax,%eax
f01004f0:	01 c2                	add    %eax,%edx
f01004f2:	8b 45 08             	mov    0x8(%ebp),%eax
f01004f5:	b0 00                	mov    $0x0,%al
f01004f7:	83 c8 20             	or     $0x20,%eax
f01004fa:	66 89 02             	mov    %ax,(%edx)
f01004fd:	e9 ba 00 00 00       	jmp    f01005bc <cga_putc+0x14c>
		}
		break;
	case '\n':
		crt_pos += CRT_COLS;
f0100502:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f0100509:	83 c0 50             	add    $0x50,%eax
f010050c:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
		/* fallthru */
	case '\r':
		crt_pos -= (crt_pos % CRT_COLS);
f0100512:	0f b7 0d f0 35 11 f0 	movzwl 0xf01135f0,%ecx
f0100519:	0f b7 15 f0 35 11 f0 	movzwl 0xf01135f0,%edx
f0100520:	0f b7 c2             	movzwl %dx,%eax
f0100523:	69 c0 cd cc 00 00    	imul   $0xcccd,%eax,%eax
f0100529:	c1 e8 10             	shr    $0x10,%eax
f010052c:	89 c3                	mov    %eax,%ebx
f010052e:	66 c1 eb 06          	shr    $0x6,%bx
f0100532:	66 89 5d ca          	mov    %bx,-0x36(%ebp)
f0100536:	0f b7 45 ca          	movzwl -0x36(%ebp),%eax
f010053a:	c1 e0 02             	shl    $0x2,%eax
f010053d:	66 03 45 ca          	add    -0x36(%ebp),%ax
f0100541:	c1 e0 04             	shl    $0x4,%eax
f0100544:	89 d3                	mov    %edx,%ebx
f0100546:	66 29 c3             	sub    %ax,%bx
f0100549:	66 89 5d ca          	mov    %bx,-0x36(%ebp)
f010054d:	89 c8                	mov    %ecx,%eax
f010054f:	66 2b 45 ca          	sub    -0x36(%ebp),%ax
f0100553:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
f0100559:	eb 61                	jmp    f01005bc <cga_putc+0x14c>
		break;
	case '\t':
		cons_putc(' ');
f010055b:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f0100562:	e8 97 03 00 00       	call   f01008fe <cons_putc>
		cons_putc(' ');
f0100567:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f010056e:	e8 8b 03 00 00       	call   f01008fe <cons_putc>
		cons_putc(' ');
f0100573:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f010057a:	e8 7f 03 00 00       	call   f01008fe <cons_putc>
		cons_putc(' ');
f010057f:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f0100586:	e8 73 03 00 00       	call   f01008fe <cons_putc>
		cons_putc(' ');
f010058b:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f0100592:	e8 67 03 00 00       	call   f01008fe <cons_putc>
f0100597:	eb 23                	jmp    f01005bc <cga_putc+0x14c>
		break;
	default:
		crt_buf[crt_pos++] = c;		/* write the character */
f0100599:	8b 15 ec 35 11 f0    	mov    0xf01135ec,%edx
f010059f:	0f b7 0d f0 35 11 f0 	movzwl 0xf01135f0,%ecx
f01005a6:	0f b7 c1             	movzwl %cx,%eax
f01005a9:	01 c0                	add    %eax,%eax
f01005ab:	01 c2                	add    %eax,%edx
f01005ad:	8b 45 08             	mov    0x8(%ebp),%eax
f01005b0:	66 89 02             	mov    %ax,(%edx)
f01005b3:	8d 41 01             	lea    0x1(%ecx),%eax
f01005b6:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
		break;
	}

	// What is the purpose of this?
	if (crt_pos >= CRT_SIZE) {
f01005bc:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f01005c3:	66 3d cf 07          	cmp    $0x7cf,%ax
f01005c7:	76 5d                	jbe    f0100626 <cga_putc+0x1b6>
		int i;

		memcpy(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
f01005c9:	a1 ec 35 11 f0       	mov    0xf01135ec,%eax
f01005ce:	05 a0 00 00 00       	add    $0xa0,%eax
f01005d3:	8b 15 ec 35 11 f0    	mov    0xf01135ec,%edx
f01005d9:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
f01005e0:	00 
f01005e1:	89 44 24 04          	mov    %eax,0x4(%esp)
f01005e5:	89 14 24             	mov    %edx,(%esp)
f01005e8:	e8 d4 2c 00 00       	call   f01032c1 <memcpy>
		for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i++)
f01005ed:	c7 45 d8 80 07 00 00 	movl   $0x780,-0x28(%ebp)
f01005f4:	eb 17                	jmp    f010060d <cga_putc+0x19d>
			crt_buf[i] = 0x0700 | ' ';
f01005f6:	8b 15 ec 35 11 f0    	mov    0xf01135ec,%edx
f01005fc:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01005ff:	01 c0                	add    %eax,%eax
f0100601:	8d 04 02             	lea    (%edx,%eax,1),%eax
f0100604:	66 c7 00 20 07       	movw   $0x720,(%eax)
	// What is the purpose of this?
	if (crt_pos >= CRT_SIZE) {
		int i;

		memcpy(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
		for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i++)
f0100609:	83 45 d8 01          	addl   $0x1,-0x28(%ebp)
f010060d:	81 7d d8 cf 07 00 00 	cmpl   $0x7cf,-0x28(%ebp)
f0100614:	7e e0                	jle    f01005f6 <cga_putc+0x186>
			crt_buf[i] = 0x0700 | ' ';
		crt_pos -= CRT_COLS;
f0100616:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f010061d:	83 e8 50             	sub    $0x50,%eax
f0100620:	66 a3 f0 35 11 f0    	mov    %ax,0xf01135f0
	}

	/* move that little blinky thing */
	outb(addr_6845, 14);
f0100626:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f010062b:	89 45 e0             	mov    %eax,-0x20(%ebp)
f010062e:	c6 45 df 0e          	movb   $0xe,-0x21(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100632:	0f b6 45 df          	movzbl -0x21(%ebp),%eax
f0100636:	8b 55 e0             	mov    -0x20(%ebp),%edx
f0100639:	ee                   	out    %al,(%dx)
	outb(addr_6845 + 1, crt_pos >> 8);
f010063a:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f0100641:	66 c1 e8 08          	shr    $0x8,%ax
f0100645:	0f b6 d0             	movzbl %al,%edx
f0100648:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f010064d:	83 c0 01             	add    $0x1,%eax
f0100650:	89 45 e8             	mov    %eax,-0x18(%ebp)
f0100653:	88 55 e7             	mov    %dl,-0x19(%ebp)
f0100656:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
f010065a:	8b 55 e8             	mov    -0x18(%ebp),%edx
f010065d:	ee                   	out    %al,(%dx)
	outb(addr_6845, 15);
f010065e:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f0100663:	89 45 f0             	mov    %eax,-0x10(%ebp)
f0100666:	c6 45 ef 0f          	movb   $0xf,-0x11(%ebp)
f010066a:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
f010066e:	8b 55 f0             	mov    -0x10(%ebp),%edx
f0100671:	ee                   	out    %al,(%dx)
	outb(addr_6845 + 1, crt_pos);
f0100672:	0f b7 05 f0 35 11 f0 	movzwl 0xf01135f0,%eax
f0100679:	0f b6 d0             	movzbl %al,%edx
f010067c:	a1 e8 35 11 f0       	mov    0xf01135e8,%eax
f0100681:	83 c0 01             	add    $0x1,%eax
f0100684:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0100687:	88 55 f7             	mov    %dl,-0x9(%ebp)
f010068a:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
f010068e:	8b 55 f8             	mov    -0x8(%ebp),%edx
f0100691:	ee                   	out    %al,(%dx)
}
f0100692:	83 c4 44             	add    $0x44,%esp
f0100695:	5b                   	pop    %ebx
f0100696:	5d                   	pop    %ebp
f0100697:	c3                   	ret    

f0100698 <kbd_proc_data>:
 * Get data from the keyboard.  If we finish a character, return it.  Else 0.
 * Return -1 if no data.
 */
static int
kbd_proc_data(void)
{
f0100698:	55                   	push   %ebp
f0100699:	89 e5                	mov    %esp,%ebp
f010069b:	83 ec 38             	sub    $0x38,%esp
f010069e:	c7 45 ec 64 00 00 00 	movl   $0x64,-0x14(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01006a5:	8b 55 ec             	mov    -0x14(%ebp),%edx
f01006a8:	ec                   	in     (%dx),%al
f01006a9:	88 45 f3             	mov    %al,-0xd(%ebp)
	return data;
f01006ac:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
	int c;
	uint8_t data;
	static uint32_t shift;

	if ((inb(KBSTATP) & KBS_DIB) == 0)
f01006b0:	0f b6 c0             	movzbl %al,%eax
f01006b3:	83 e0 01             	and    $0x1,%eax
f01006b6:	85 c0                	test   %eax,%eax
f01006b8:	75 0c                	jne    f01006c6 <kbd_proc_data+0x2e>
		return -1;
f01006ba:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
f01006c1:	e9 6b 01 00 00       	jmp    f0100831 <kbd_proc_data+0x199>
f01006c6:	c7 45 f4 60 00 00 00 	movl   $0x60,-0xc(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01006cd:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01006d0:	ec                   	in     (%dx),%al
f01006d1:	88 45 fa             	mov    %al,-0x6(%ebp)
	return data;
f01006d4:	0f b6 45 fa          	movzbl -0x6(%ebp),%eax

	data = inb(KBDATAP);
f01006d8:	88 45 eb             	mov    %al,-0x15(%ebp)

	if (data == 0xE0) {
f01006db:	80 7d eb e0          	cmpb   $0xe0,-0x15(%ebp)
f01006df:	75 19                	jne    f01006fa <kbd_proc_data+0x62>
		// E0 escape character
		shift |= E0ESC;
f01006e1:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f01006e6:	83 c8 40             	or     $0x40,%eax
f01006e9:	a3 e0 35 11 f0       	mov    %eax,0xf01135e0
		return 0;
f01006ee:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
f01006f5:	e9 37 01 00 00       	jmp    f0100831 <kbd_proc_data+0x199>
	} else if (data & 0x80) {
f01006fa:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f01006fe:	84 c0                	test   %al,%al
f0100700:	79 55                	jns    f0100757 <kbd_proc_data+0xbf>
		// Key released
		data = (shift & E0ESC ? data : data & 0x7F);
f0100702:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f0100707:	83 e0 40             	and    $0x40,%eax
f010070a:	85 c0                	test   %eax,%eax
f010070c:	75 0e                	jne    f010071c <kbd_proc_data+0x84>
f010070e:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f0100712:	89 c2                	mov    %eax,%edx
f0100714:	83 e2 7f             	and    $0x7f,%edx
f0100717:	88 55 df             	mov    %dl,-0x21(%ebp)
f010071a:	eb 07                	jmp    f0100723 <kbd_proc_data+0x8b>
f010071c:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f0100720:	88 45 df             	mov    %al,-0x21(%ebp)
f0100723:	0f b6 55 df          	movzbl -0x21(%ebp),%edx
f0100727:	88 55 eb             	mov    %dl,-0x15(%ebp)
		shift &= ~(shiftcode[data] | E0ESC);
f010072a:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f010072e:	0f b6 80 20 30 11 f0 	movzbl -0xfeecfe0(%eax),%eax
f0100735:	83 c8 40             	or     $0x40,%eax
f0100738:	0f b6 c0             	movzbl %al,%eax
f010073b:	f7 d0                	not    %eax
f010073d:	89 c2                	mov    %eax,%edx
f010073f:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f0100744:	21 d0                	and    %edx,%eax
f0100746:	a3 e0 35 11 f0       	mov    %eax,0xf01135e0
		return 0;
f010074b:	c7 45 d8 00 00 00 00 	movl   $0x0,-0x28(%ebp)
f0100752:	e9 da 00 00 00       	jmp    f0100831 <kbd_proc_data+0x199>
	} else if (shift & E0ESC) {
f0100757:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f010075c:	83 e0 40             	and    $0x40,%eax
f010075f:	85 c0                	test   %eax,%eax
f0100761:	74 11                	je     f0100774 <kbd_proc_data+0xdc>
		// Last character was an E0 escape; or with 0x80
		data |= 0x80;
f0100763:	80 4d eb 80          	orb    $0x80,-0x15(%ebp)
		shift &= ~E0ESC;
f0100767:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f010076c:	83 e0 bf             	and    $0xffffffbf,%eax
f010076f:	a3 e0 35 11 f0       	mov    %eax,0xf01135e0
	}

	shift |= shiftcode[data];
f0100774:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f0100778:	0f b6 80 20 30 11 f0 	movzbl -0xfeecfe0(%eax),%eax
f010077f:	0f b6 d0             	movzbl %al,%edx
f0100782:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f0100787:	09 d0                	or     %edx,%eax
f0100789:	a3 e0 35 11 f0       	mov    %eax,0xf01135e0
	shift ^= togglecode[data];
f010078e:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f0100792:	0f b6 80 20 31 11 f0 	movzbl -0xfeecee0(%eax),%eax
f0100799:	0f b6 d0             	movzbl %al,%edx
f010079c:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f01007a1:	31 d0                	xor    %edx,%eax
f01007a3:	a3 e0 35 11 f0       	mov    %eax,0xf01135e0

	c = charcode[shift & (CTL | SHIFT)][data];
f01007a8:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f01007ad:	83 e0 03             	and    $0x3,%eax
f01007b0:	8b 14 85 20 35 11 f0 	mov    -0xfeecae0(,%eax,4),%edx
f01007b7:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
f01007bb:	8d 04 02             	lea    (%edx,%eax,1),%eax
f01007be:	0f b6 00             	movzbl (%eax),%eax
f01007c1:	0f b6 c0             	movzbl %al,%eax
f01007c4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	if (shift & CAPSLOCK) {
f01007c7:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f01007cc:	83 e0 08             	and    $0x8,%eax
f01007cf:	85 c0                	test   %eax,%eax
f01007d1:	74 22                	je     f01007f5 <kbd_proc_data+0x15d>
		if ('a' <= c && c <= 'z')
f01007d3:	83 7d e4 60          	cmpl   $0x60,-0x1c(%ebp)
f01007d7:	7e 0c                	jle    f01007e5 <kbd_proc_data+0x14d>
f01007d9:	83 7d e4 7a          	cmpl   $0x7a,-0x1c(%ebp)
f01007dd:	7f 06                	jg     f01007e5 <kbd_proc_data+0x14d>
			c += 'A' - 'a';
f01007df:	83 6d e4 20          	subl   $0x20,-0x1c(%ebp)
f01007e3:	eb 10                	jmp    f01007f5 <kbd_proc_data+0x15d>
		else if ('A' <= c && c <= 'Z')
f01007e5:	83 7d e4 40          	cmpl   $0x40,-0x1c(%ebp)
f01007e9:	7e 0a                	jle    f01007f5 <kbd_proc_data+0x15d>
f01007eb:	83 7d e4 5a          	cmpl   $0x5a,-0x1c(%ebp)
f01007ef:	7f 04                	jg     f01007f5 <kbd_proc_data+0x15d>
			c += 'a' - 'A';
f01007f1:	83 45 e4 20          	addl   $0x20,-0x1c(%ebp)
	}

	// Process special keys
	// Ctrl-Alt-Del: reboot
	if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
f01007f5:	a1 e0 35 11 f0       	mov    0xf01135e0,%eax
f01007fa:	f7 d0                	not    %eax
f01007fc:	83 e0 06             	and    $0x6,%eax
f01007ff:	85 c0                	test   %eax,%eax
f0100801:	75 28                	jne    f010082b <kbd_proc_data+0x193>
f0100803:	81 7d e4 e9 00 00 00 	cmpl   $0xe9,-0x1c(%ebp)
f010080a:	75 1f                	jne    f010082b <kbd_proc_data+0x193>
		cprintf("Rebooting!\n");
f010080c:	c7 04 24 c5 38 10 f0 	movl   $0xf01038c5,(%esp)
f0100813:	e8 4f 1c 00 00       	call   f0102467 <cprintf>
f0100818:	c7 45 fc 92 00 00 00 	movl   $0x92,-0x4(%ebp)
f010081f:	c6 45 fb 03          	movb   $0x3,-0x5(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100823:	0f b6 45 fb          	movzbl -0x5(%ebp),%eax
f0100827:	8b 55 fc             	mov    -0x4(%ebp),%edx
f010082a:	ee                   	out    %al,(%dx)
		outb(0x92, 0x3); // courtesy of Chris Frost
	}

	return c;
f010082b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f010082e:	89 45 d8             	mov    %eax,-0x28(%ebp)
f0100831:	8b 45 d8             	mov    -0x28(%ebp),%eax
}
f0100834:	c9                   	leave  
f0100835:	c3                   	ret    

f0100836 <kbd_intr>:

void
kbd_intr(void)
{
f0100836:	55                   	push   %ebp
f0100837:	89 e5                	mov    %esp,%ebp
f0100839:	83 ec 08             	sub    $0x8,%esp
	cons_intr(kbd_proc_data);
f010083c:	c7 04 24 98 06 10 f0 	movl   $0xf0100698,(%esp)
f0100843:	e8 07 00 00 00       	call   f010084f <cons_intr>
}
f0100848:	c9                   	leave  
f0100849:	c3                   	ret    

f010084a <kbd_init>:

void
kbd_init(void)
{
f010084a:	55                   	push   %ebp
f010084b:	89 e5                	mov    %esp,%ebp
}
f010084d:	5d                   	pop    %ebp
f010084e:	c3                   	ret    

f010084f <cons_intr>:

// called by device interrupt routines to feed input characters
// into the circular console input buffer.
void
cons_intr(int (*proc)(void))
{
f010084f:	55                   	push   %ebp
f0100850:	89 e5                	mov    %esp,%ebp
f0100852:	83 ec 18             	sub    $0x18,%esp
f0100855:	eb 33                	jmp    f010088a <cons_intr+0x3b>
	int c;

	while ((c = (*proc)()) != -1) {
		if (c == 0)
f0100857:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f010085b:	74 2d                	je     f010088a <cons_intr+0x3b>
			continue;
		cons.buf[cons.wpos++] = c;
f010085d:	8b 15 04 38 11 f0    	mov    0xf0113804,%edx
f0100863:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100866:	88 82 00 36 11 f0    	mov    %al,-0xfeeca00(%edx)
f010086c:	8d 42 01             	lea    0x1(%edx),%eax
f010086f:	a3 04 38 11 f0       	mov    %eax,0xf0113804
		if (cons.wpos == CONSBUFSIZE)
f0100874:	a1 04 38 11 f0       	mov    0xf0113804,%eax
f0100879:	3d 00 02 00 00       	cmp    $0x200,%eax
f010087e:	75 0a                	jne    f010088a <cons_intr+0x3b>
			cons.wpos = 0;
f0100880:	c7 05 04 38 11 f0 00 	movl   $0x0,0xf0113804
f0100887:	00 00 00 
void
cons_intr(int (*proc)(void))
{
	int c;

	while ((c = (*proc)()) != -1) {
f010088a:	8b 45 08             	mov    0x8(%ebp),%eax
f010088d:	ff d0                	call   *%eax
f010088f:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0100892:	83 7d fc ff          	cmpl   $0xffffffff,-0x4(%ebp)
f0100896:	75 bf                	jne    f0100857 <cons_intr+0x8>
			continue;
		cons.buf[cons.wpos++] = c;
		if (cons.wpos == CONSBUFSIZE)
			cons.wpos = 0;
	}
}
f0100898:	c9                   	leave  
f0100899:	c3                   	ret    

f010089a <cons_getc>:

// return the next input character from the console, or 0 if none waiting
int
cons_getc(void)
{
f010089a:	55                   	push   %ebp
f010089b:	89 e5                	mov    %esp,%ebp
f010089d:	83 ec 18             	sub    $0x18,%esp
	int c;

	// poll for any pending input characters,
	// so that this function works even when interrupts are disabled
	// (e.g., when called from the kernel monitor).
	serial_intr();
f01008a0:	e8 67 f9 ff ff       	call   f010020c <serial_intr>
	kbd_intr();
f01008a5:	e8 8c ff ff ff       	call   f0100836 <kbd_intr>

	// grab the next character from the input buffer.
	if (cons.rpos != cons.wpos) {
f01008aa:	8b 15 00 38 11 f0    	mov    0xf0113800,%edx
f01008b0:	a1 04 38 11 f0       	mov    0xf0113804,%eax
f01008b5:	39 c2                	cmp    %eax,%edx
f01008b7:	74 39                	je     f01008f2 <cons_getc+0x58>
		c = cons.buf[cons.rpos++];
f01008b9:	8b 15 00 38 11 f0    	mov    0xf0113800,%edx
f01008bf:	0f b6 82 00 36 11 f0 	movzbl -0xfeeca00(%edx),%eax
f01008c6:	0f b6 c0             	movzbl %al,%eax
f01008c9:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01008cc:	8d 42 01             	lea    0x1(%edx),%eax
f01008cf:	a3 00 38 11 f0       	mov    %eax,0xf0113800
		if (cons.rpos == CONSBUFSIZE)
f01008d4:	a1 00 38 11 f0       	mov    0xf0113800,%eax
f01008d9:	3d 00 02 00 00       	cmp    $0x200,%eax
f01008de:	75 0a                	jne    f01008ea <cons_getc+0x50>
			cons.rpos = 0;
f01008e0:	c7 05 00 38 11 f0 00 	movl   $0x0,0xf0113800
f01008e7:	00 00 00 
		return c;
f01008ea:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01008ed:	89 45 ec             	mov    %eax,-0x14(%ebp)
f01008f0:	eb 07                	jmp    f01008f9 <cons_getc+0x5f>
	}
	return 0;
f01008f2:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
f01008f9:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f01008fc:	c9                   	leave  
f01008fd:	c3                   	ret    

f01008fe <cons_putc>:

// output a character to the console
void
cons_putc(int c)
{
f01008fe:	55                   	push   %ebp
f01008ff:	89 e5                	mov    %esp,%ebp
f0100901:	83 ec 08             	sub    $0x8,%esp
	lpt_putc(c);
f0100904:	8b 45 08             	mov    0x8(%ebp),%eax
f0100907:	89 04 24             	mov    %eax,(%esp)
f010090a:	e8 22 fa ff ff       	call   f0100331 <lpt_putc>
	cga_putc(c);
f010090f:	8b 45 08             	mov    0x8(%ebp),%eax
f0100912:	89 04 24             	mov    %eax,(%esp)
f0100915:	e8 56 fb ff ff       	call   f0100470 <cga_putc>
}
f010091a:	c9                   	leave  
f010091b:	c3                   	ret    

f010091c <cons_init>:

// initialize the console devices
void
cons_init(void)
{
f010091c:	55                   	push   %ebp
f010091d:	89 e5                	mov    %esp,%ebp
f010091f:	83 ec 08             	sub    $0x8,%esp
	cga_init();
f0100922:	e8 81 fa ff ff       	call   f01003a8 <cga_init>
	kbd_init();
f0100927:	e8 1e ff ff ff       	call   f010084a <kbd_init>
	serial_init();
f010092c:	e8 f8 f8 ff ff       	call   f0100229 <serial_init>

	if (!serial_exists)
f0100931:	a1 e4 35 11 f0       	mov    0xf01135e4,%eax
f0100936:	85 c0                	test   %eax,%eax
f0100938:	75 0c                	jne    f0100946 <cons_init+0x2a>
		cprintf("Serial port does not exist!\n");
f010093a:	c7 04 24 d1 38 10 f0 	movl   $0xf01038d1,(%esp)
f0100941:	e8 21 1b 00 00       	call   f0102467 <cprintf>
}
f0100946:	c9                   	leave  
f0100947:	c3                   	ret    

f0100948 <cputchar>:

// `High'-level console I/O.  Used by readline and cprintf.

void
cputchar(int c)
{
f0100948:	55                   	push   %ebp
f0100949:	89 e5                	mov    %esp,%ebp
f010094b:	83 ec 08             	sub    $0x8,%esp
	cons_putc(c);
f010094e:	8b 45 08             	mov    0x8(%ebp),%eax
f0100951:	89 04 24             	mov    %eax,(%esp)
f0100954:	e8 a5 ff ff ff       	call   f01008fe <cons_putc>
}
f0100959:	c9                   	leave  
f010095a:	c3                   	ret    

f010095b <getchar>:

int
getchar(void)
{
f010095b:	55                   	push   %ebp
f010095c:	89 e5                	mov    %esp,%ebp
f010095e:	83 ec 18             	sub    $0x18,%esp
	int c;

	while ((c = cons_getc()) == 0)
f0100961:	e8 34 ff ff ff       	call   f010089a <cons_getc>
f0100966:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0100969:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f010096d:	74 f2                	je     f0100961 <getchar+0x6>
		/* do nothing */;
	return c;
f010096f:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0100972:	c9                   	leave  
f0100973:	c3                   	ret    

f0100974 <iscons>:

int
iscons(int fdnum)
{
f0100974:	55                   	push   %ebp
f0100975:	89 e5                	mov    %esp,%ebp
	// used by readline
	return 1;
f0100977:	b8 01 00 00 00       	mov    $0x1,%eax
}
f010097c:	5d                   	pop    %ebp
f010097d:	c3                   	ret    
	...

f0100980 <mon_help>:

/***** Implementations of basic kernel monitor commands *****/

int
mon_help(int argc, char **argv, struct Trapframe *tf)
{
f0100980:	55                   	push   %ebp
f0100981:	89 e5                	mov    %esp,%ebp
f0100983:	83 ec 28             	sub    $0x28,%esp
	int i;

	for (i = 0; i < NCOMMANDS; i++)
f0100986:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f010098d:	eb 3c                	jmp    f01009cb <mon_help+0x4b>
		cprintf("%s - %s\n", commands[i].name, commands[i].desc);
f010098f:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0100992:	89 d0                	mov    %edx,%eax
f0100994:	01 c0                	add    %eax,%eax
f0100996:	01 d0                	add    %edx,%eax
f0100998:	c1 e0 02             	shl    $0x2,%eax
f010099b:	8b 88 44 35 11 f0    	mov    -0xfeecabc(%eax),%ecx
f01009a1:	8b 55 fc             	mov    -0x4(%ebp),%edx
f01009a4:	89 d0                	mov    %edx,%eax
f01009a6:	01 c0                	add    %eax,%eax
f01009a8:	01 d0                	add    %edx,%eax
f01009aa:	c1 e0 02             	shl    $0x2,%eax
f01009ad:	8b 80 40 35 11 f0    	mov    -0xfeecac0(%eax),%eax
f01009b3:	89 4c 24 08          	mov    %ecx,0x8(%esp)
f01009b7:	89 44 24 04          	mov    %eax,0x4(%esp)
f01009bb:	c7 04 24 62 39 10 f0 	movl   $0xf0103962,(%esp)
f01009c2:	e8 a0 1a 00 00       	call   f0102467 <cprintf>
int
mon_help(int argc, char **argv, struct Trapframe *tf)
{
	int i;

	for (i = 0; i < NCOMMANDS; i++)
f01009c7:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
f01009cb:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01009ce:	83 f8 02             	cmp    $0x2,%eax
f01009d1:	76 bc                	jbe    f010098f <mon_help+0xf>
		cprintf("%s - %s\n", commands[i].name, commands[i].desc);
	return 0;
f01009d3:	b8 00 00 00 00       	mov    $0x0,%eax
}
f01009d8:	c9                   	leave  
f01009d9:	c3                   	ret    

f01009da <mon_kerninfo>:

int
mon_kerninfo(int argc, char **argv, struct Trapframe *tf)
{
f01009da:	55                   	push   %ebp
f01009db:	89 e5                	mov    %esp,%ebp
f01009dd:	83 ec 18             	sub    $0x18,%esp
	extern char _start[], etext[], edata[], end[];

	cprintf("Special kernel symbols:\n");
f01009e0:	c7 04 24 6b 39 10 f0 	movl   $0xf010396b,(%esp)
f01009e7:	e8 7b 1a 00 00       	call   f0102467 <cprintf>
	cprintf("  _start %08x (virt)  %08x (phys)\n", _start, _start - KERNBASE);
f01009ec:	c7 44 24 08 0c 00 10 	movl   $0x10000c,0x8(%esp)
f01009f3:	00 
f01009f4:	c7 44 24 04 0c 00 10 	movl   $0xf010000c,0x4(%esp)
f01009fb:	f0 
f01009fc:	c7 04 24 84 39 10 f0 	movl   $0xf0103984,(%esp)
f0100a03:	e8 5f 1a 00 00       	call   f0102467 <cprintf>
	cprintf("  etext  %08x (virt)  %08x (phys)\n", etext, etext - KERNBASE);
f0100a08:	c7 44 24 08 25 38 10 	movl   $0x103825,0x8(%esp)
f0100a0f:	00 
f0100a10:	c7 44 24 04 25 38 10 	movl   $0xf0103825,0x4(%esp)
f0100a17:	f0 
f0100a18:	c7 04 24 a8 39 10 f0 	movl   $0xf01039a8,(%esp)
f0100a1f:	e8 43 1a 00 00       	call   f0102467 <cprintf>
	cprintf("  edata  %08x (virt)  %08x (phys)\n", edata, edata - KERNBASE);
f0100a24:	c7 44 24 08 b8 35 11 	movl   $0x1135b8,0x8(%esp)
f0100a2b:	00 
f0100a2c:	c7 44 24 04 b8 35 11 	movl   $0xf01135b8,0x4(%esp)
f0100a33:	f0 
f0100a34:	c7 04 24 cc 39 10 f0 	movl   $0xf01039cc,(%esp)
f0100a3b:	e8 27 1a 00 00       	call   f0102467 <cprintf>
	cprintf("  end    %08x (virt)  %08x (phys)\n", end, end - KERNBASE);
f0100a40:	c7 44 24 08 30 3c 11 	movl   $0x113c30,0x8(%esp)
f0100a47:	00 
f0100a48:	c7 44 24 04 30 3c 11 	movl   $0xf0113c30,0x4(%esp)
f0100a4f:	f0 
f0100a50:	c7 04 24 f0 39 10 f0 	movl   $0xf01039f0,(%esp)
f0100a57:	e8 0b 1a 00 00       	call   f0102467 <cprintf>
	cprintf("Kernel executable memory footprint: %dKB\n",
f0100a5c:	ba 0c 00 10 f0       	mov    $0xf010000c,%edx
f0100a61:	b8 ff 03 00 00       	mov    $0x3ff,%eax
f0100a66:	29 d0                	sub    %edx,%eax
f0100a68:	05 30 3c 11 f0       	add    $0xf0113c30,%eax
f0100a6d:	89 c2                	mov    %eax,%edx
f0100a6f:	89 d0                	mov    %edx,%eax
f0100a71:	c1 f8 1f             	sar    $0x1f,%eax
f0100a74:	c1 e8 16             	shr    $0x16,%eax
f0100a77:	01 d0                	add    %edx,%eax
f0100a79:	c1 f8 0a             	sar    $0xa,%eax
f0100a7c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100a80:	c7 04 24 14 3a 10 f0 	movl   $0xf0103a14,(%esp)
f0100a87:	e8 db 19 00 00       	call   f0102467 <cprintf>
		(end-_start+1023)/1024);
	return 0;
f0100a8c:	b8 00 00 00 00       	mov    $0x0,%eax
}
f0100a91:	c9                   	leave  
f0100a92:	c3                   	ret    

f0100a93 <mon_backtrace>:

void test_backtrace(int x);

int
mon_backtrace(int argc, char **argv, struct Trapframe *tf)
{
f0100a93:	55                   	push   %ebp
f0100a94:	89 e5                	mov    %esp,%ebp
f0100a96:	56                   	push   %esi
f0100a97:	53                   	push   %ebx
f0100a98:	83 ec 50             	sub    $0x50,%esp

static __inline uint32_t
read_ebp(void)
{
        uint32_t ebp;
        __asm __volatile("movl %%ebp,%0" : "=r" (ebp));
f0100a9b:	89 e8                	mov    %ebp,%eax
f0100a9d:	89 45 f4             	mov    %eax,-0xc(%ebp)
        return ebp;
f0100aa0:	8b 45 f4             	mov    -0xc(%ebp),%eax
	uint32_t ebp = read_ebp();
f0100aa3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	uint32_t args[5];
	uint32_t i, desplazamiento;
	
	do
	{
		desplazamiento = 4;
f0100aa6:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
		eip = *((uint32_t*)(ebp + desplazamiento));
f0100aad:	8b 55 f0             	mov    -0x10(%ebp),%edx
f0100ab0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0100ab3:	01 d0                	add    %edx,%eax
f0100ab5:	8b 00                	mov    (%eax),%eax
f0100ab7:	89 45 e8             	mov    %eax,-0x18(%ebp)
		
		for(i = 0; i < 5; i++)
f0100aba:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
f0100ac1:	eb 19                	jmp    f0100adc <mon_backtrace+0x49>
		{
			desplazamiento+= 4;
f0100ac3:	83 45 f0 04          	addl   $0x4,-0x10(%ebp)
			args[i] = *((uint32_t*)(ebp + desplazamiento));
f0100ac7:	8b 4d ec             	mov    -0x14(%ebp),%ecx
f0100aca:	8b 55 f0             	mov    -0x10(%ebp),%edx
f0100acd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0100ad0:	01 d0                	add    %edx,%eax
f0100ad2:	8b 00                	mov    (%eax),%eax
f0100ad4:	89 44 8d d0          	mov    %eax,-0x30(%ebp,%ecx,4)
	do
	{
		desplazamiento = 4;
		eip = *((uint32_t*)(ebp + desplazamiento));
		
		for(i = 0; i < 5; i++)
f0100ad8:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
f0100adc:	83 7d ec 04          	cmpl   $0x4,-0x14(%ebp)
f0100ae0:	76 e1                	jbe    f0100ac3 <mon_backtrace+0x30>
		{
			desplazamiento+= 4;
			args[i] = *((uint32_t*)(ebp + desplazamiento));
		}
		
		cprintf("ebp %08x eip %08x args %08x %08x %08x %08x %08x\n", ebp, eip, args[0], args[1], args[2], args[3], args[4]);
f0100ae2:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0100ae5:	8b 55 dc             	mov    -0x24(%ebp),%edx
f0100ae8:	8b 4d d8             	mov    -0x28(%ebp),%ecx
f0100aeb:	8b 5d d4             	mov    -0x2c(%ebp),%ebx
f0100aee:	8b 75 d0             	mov    -0x30(%ebp),%esi
f0100af1:	89 44 24 1c          	mov    %eax,0x1c(%esp)
f0100af5:	89 54 24 18          	mov    %edx,0x18(%esp)
f0100af9:	89 4c 24 14          	mov    %ecx,0x14(%esp)
f0100afd:	89 5c 24 10          	mov    %ebx,0x10(%esp)
f0100b01:	89 74 24 0c          	mov    %esi,0xc(%esp)
f0100b05:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0100b08:	89 44 24 08          	mov    %eax,0x8(%esp)
f0100b0c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0100b0f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100b13:	c7 04 24 40 3a 10 f0 	movl   $0xf0103a40,(%esp)
f0100b1a:	e8 48 19 00 00       	call   f0102467 <cprintf>
		
		ebp = *((uint32_t*)ebp);
f0100b1f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0100b22:	8b 00                	mov    (%eax),%eax
f0100b24:	89 45 e4             	mov    %eax,-0x1c(%ebp)
	} while(ebp != 0);
f0100b27:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
f0100b2b:	0f 85 75 ff ff ff    	jne    f0100aa6 <mon_backtrace+0x13>
	
	return 0;
f0100b31:	b8 00 00 00 00       	mov    $0x0,%eax
}
f0100b36:	83 c4 50             	add    $0x50,%esp
f0100b39:	5b                   	pop    %ebx
f0100b3a:	5e                   	pop    %esi
f0100b3b:	5d                   	pop    %ebp
f0100b3c:	c3                   	ret    

f0100b3d <runcmd>:
#define WHITESPACE "\t\r\n "
#define MAXARGS 16

static int
runcmd(char *buf, struct Trapframe *tf)
{
f0100b3d:	55                   	push   %ebp
f0100b3e:	89 e5                	mov    %esp,%ebp
f0100b40:	83 ec 68             	sub    $0x68,%esp
	int argc;
	char *argv[MAXARGS];
	int i;

	// Parse the command buffer into whitespace-separated arguments
	argc = 0;
f0100b43:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
	argv[argc] = 0;
f0100b4a:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100b4d:	c7 44 85 b8 00 00 00 	movl   $0x0,-0x48(%ebp,%eax,4)
f0100b54:	00 
f0100b55:	eb 0a                	jmp    f0100b61 <runcmd+0x24>
	while (1) {
		// gobble whitespace
		while (*buf && strchr(WHITESPACE, *buf))
			*buf++ = 0;
f0100b57:	8b 45 08             	mov    0x8(%ebp),%eax
f0100b5a:	c6 00 00             	movb   $0x0,(%eax)
f0100b5d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
	// Parse the command buffer into whitespace-separated arguments
	argc = 0;
	argv[argc] = 0;
	while (1) {
		// gobble whitespace
		while (*buf && strchr(WHITESPACE, *buf))
f0100b61:	8b 45 08             	mov    0x8(%ebp),%eax
f0100b64:	0f b6 00             	movzbl (%eax),%eax
f0100b67:	84 c0                	test   %al,%al
f0100b69:	74 1d                	je     f0100b88 <runcmd+0x4b>
f0100b6b:	8b 45 08             	mov    0x8(%ebp),%eax
f0100b6e:	0f b6 00             	movzbl (%eax),%eax
f0100b71:	0f be c0             	movsbl %al,%eax
f0100b74:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100b78:	c7 04 24 71 3a 10 f0 	movl   $0xf0103a71,(%esp)
f0100b7f:	e8 a5 26 00 00       	call   f0103229 <strchr>
f0100b84:	85 c0                	test   %eax,%eax
f0100b86:	75 cf                	jne    f0100b57 <runcmd+0x1a>
			*buf++ = 0;
		if (*buf == 0)
f0100b88:	8b 45 08             	mov    0x8(%ebp),%eax
f0100b8b:	0f b6 00             	movzbl (%eax),%eax
f0100b8e:	84 c0                	test   %al,%al
f0100b90:	74 66                	je     f0100bf8 <runcmd+0xbb>
			break;

		// save and scan past next arg
		if (argc == MAXARGS-1) {
f0100b92:	83 7d f8 0f          	cmpl   $0xf,-0x8(%ebp)
f0100b96:	75 20                	jne    f0100bb8 <runcmd+0x7b>
			cprintf("Too many arguments (max %d)\n", MAXARGS);
f0100b98:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
f0100b9f:	00 
f0100ba0:	c7 04 24 76 3a 10 f0 	movl   $0xf0103a76,(%esp)
f0100ba7:	e8 bb 18 00 00       	call   f0102467 <cprintf>
			return 0;
f0100bac:	c7 45 ac 00 00 00 00 	movl   $0x0,-0x54(%ebp)
f0100bb3:	e9 de 00 00 00       	jmp    f0100c96 <runcmd+0x159>
		}
		argv[argc++] = buf;
f0100bb8:	8b 55 f8             	mov    -0x8(%ebp),%edx
f0100bbb:	8b 45 08             	mov    0x8(%ebp),%eax
f0100bbe:	89 44 95 b8          	mov    %eax,-0x48(%ebp,%edx,4)
f0100bc2:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
f0100bc6:	eb 04                	jmp    f0100bcc <runcmd+0x8f>
		while (*buf && !strchr(WHITESPACE, *buf))
			buf++;
f0100bc8:	83 45 08 01          	addl   $0x1,0x8(%ebp)
		if (argc == MAXARGS-1) {
			cprintf("Too many arguments (max %d)\n", MAXARGS);
			return 0;
		}
		argv[argc++] = buf;
		while (*buf && !strchr(WHITESPACE, *buf))
f0100bcc:	8b 45 08             	mov    0x8(%ebp),%eax
f0100bcf:	0f b6 00             	movzbl (%eax),%eax
f0100bd2:	84 c0                	test   %al,%al
f0100bd4:	74 8b                	je     f0100b61 <runcmd+0x24>
f0100bd6:	8b 45 08             	mov    0x8(%ebp),%eax
f0100bd9:	0f b6 00             	movzbl (%eax),%eax
f0100bdc:	0f be c0             	movsbl %al,%eax
f0100bdf:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100be3:	c7 04 24 71 3a 10 f0 	movl   $0xf0103a71,(%esp)
f0100bea:	e8 3a 26 00 00       	call   f0103229 <strchr>
f0100bef:	85 c0                	test   %eax,%eax
f0100bf1:	74 d5                	je     f0100bc8 <runcmd+0x8b>
f0100bf3:	e9 69 ff ff ff       	jmp    f0100b61 <runcmd+0x24>
			buf++;
	}
	argv[argc] = 0;
f0100bf8:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100bfb:	c7 44 85 b8 00 00 00 	movl   $0x0,-0x48(%ebp,%eax,4)
f0100c02:	00 

	// Lookup and invoke the command
	if (argc == 0)
f0100c03:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
f0100c07:	75 0c                	jne    f0100c15 <runcmd+0xd8>
		return 0;
f0100c09:	c7 45 ac 00 00 00 00 	movl   $0x0,-0x54(%ebp)
f0100c10:	e9 81 00 00 00       	jmp    f0100c96 <runcmd+0x159>
	for (i = 0; i < NCOMMANDS; i++) {
f0100c15:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f0100c1c:	eb 56                	jmp    f0100c74 <runcmd+0x137>
		if (strcmp(argv[0], commands[i].name) == 0)
f0100c1e:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0100c21:	89 d0                	mov    %edx,%eax
f0100c23:	01 c0                	add    %eax,%eax
f0100c25:	01 d0                	add    %edx,%eax
f0100c27:	c1 e0 02             	shl    $0x2,%eax
f0100c2a:	8b 80 40 35 11 f0    	mov    -0xfeecac0(%eax),%eax
f0100c30:	8b 55 b8             	mov    -0x48(%ebp),%edx
f0100c33:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100c37:	89 14 24             	mov    %edx,(%esp)
f0100c3a:	e8 48 25 00 00       	call   f0103187 <strcmp>
f0100c3f:	85 c0                	test   %eax,%eax
f0100c41:	75 2d                	jne    f0100c70 <runcmd+0x133>
			return commands[i].func(argc, argv, tf);
f0100c43:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0100c46:	89 d0                	mov    %edx,%eax
f0100c48:	01 c0                	add    %eax,%eax
f0100c4a:	01 d0                	add    %edx,%eax
f0100c4c:	c1 e0 02             	shl    $0x2,%eax
f0100c4f:	8b 90 48 35 11 f0    	mov    -0xfeecab8(%eax),%edx
f0100c55:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100c58:	89 44 24 08          	mov    %eax,0x8(%esp)
f0100c5c:	8d 45 b8             	lea    -0x48(%ebp),%eax
f0100c5f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100c63:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100c66:	89 04 24             	mov    %eax,(%esp)
f0100c69:	ff d2                	call   *%edx
f0100c6b:	89 45 ac             	mov    %eax,-0x54(%ebp)
f0100c6e:	eb 26                	jmp    f0100c96 <runcmd+0x159>
	argv[argc] = 0;

	// Lookup and invoke the command
	if (argc == 0)
		return 0;
	for (i = 0; i < NCOMMANDS; i++) {
f0100c70:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
f0100c74:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100c77:	83 f8 02             	cmp    $0x2,%eax
f0100c7a:	76 a2                	jbe    f0100c1e <runcmd+0xe1>
		if (strcmp(argv[0], commands[i].name) == 0)
			return commands[i].func(argc, argv, tf);
	}
	cprintf("Unknown command '%s'\n", argv[0]);
f0100c7c:	8b 45 b8             	mov    -0x48(%ebp),%eax
f0100c7f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100c83:	c7 04 24 93 3a 10 f0 	movl   $0xf0103a93,(%esp)
f0100c8a:	e8 d8 17 00 00       	call   f0102467 <cprintf>
	return 0;
f0100c8f:	c7 45 ac 00 00 00 00 	movl   $0x0,-0x54(%ebp)
f0100c96:	8b 45 ac             	mov    -0x54(%ebp),%eax
}
f0100c99:	c9                   	leave  
f0100c9a:	c3                   	ret    

f0100c9b <monitor>:

void
monitor(struct Trapframe *tf)
{
f0100c9b:	55                   	push   %ebp
f0100c9c:	89 e5                	mov    %esp,%ebp
f0100c9e:	83 ec 18             	sub    $0x18,%esp
	char *buf;

	cprintf("Welcome to the JOS kernel monitor!\n");
f0100ca1:	c7 04 24 ac 3a 10 f0 	movl   $0xf0103aac,(%esp)
f0100ca8:	e8 ba 17 00 00       	call   f0102467 <cprintf>
	cprintf("Type 'help' for a list of commands.\n");
f0100cad:	c7 04 24 d0 3a 10 f0 	movl   $0xf0103ad0,(%esp)
f0100cb4:	e8 ae 17 00 00       	call   f0102467 <cprintf>


	while (1) {
		buf = readline("K> ");
f0100cb9:	c7 04 24 f5 3a 10 f0 	movl   $0xf0103af5,(%esp)
f0100cc0:	e8 b3 22 00 00       	call   f0102f78 <readline>
f0100cc5:	89 45 fc             	mov    %eax,-0x4(%ebp)
		if (buf != NULL)
f0100cc8:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f0100ccc:	74 eb                	je     f0100cb9 <monitor+0x1e>
			if (runcmd(buf, tf) < 0)
f0100cce:	8b 45 08             	mov    0x8(%ebp),%eax
f0100cd1:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100cd5:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100cd8:	89 04 24             	mov    %eax,(%esp)
f0100cdb:	e8 5d fe ff ff       	call   f0100b3d <runcmd>
f0100ce0:	85 c0                	test   %eax,%eax
f0100ce2:	79 d5                	jns    f0100cb9 <monitor+0x1e>
				break;
	}
}
f0100ce4:	c9                   	leave  
f0100ce5:	c3                   	ret    

f0100ce6 <read_eip>:
// return EIP of caller.
// does not work if inlined.
// putting at the end of the file seems to prevent inlining.
uint32_t
read_eip(void)
{
f0100ce6:	55                   	push   %ebp
f0100ce7:	89 e5                	mov    %esp,%ebp
f0100ce9:	83 ec 10             	sub    $0x10,%esp
	//__asm __volatile("movl 4(%ebp), %eax");
	uint32_t eip;
        __asm __volatile("movl 4(%%ebp),%0" : "=r" (eip));
f0100cec:	8b 45 04             	mov    0x4(%ebp),%eax
f0100cef:	89 45 fc             	mov    %eax,-0x4(%ebp)
        return eip;
f0100cf2:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0100cf5:	c9                   	leave  
f0100cf6:	c3                   	ret    
	...

f0100cf8 <nvram_read>:
	0, sizeof(gdt) - 1, (unsigned long) gdt,
};

static int
nvram_read(int r)
{
f0100cf8:	55                   	push   %ebp
f0100cf9:	89 e5                	mov    %esp,%ebp
f0100cfb:	53                   	push   %ebx
f0100cfc:	83 ec 04             	sub    $0x4,%esp
	return mc146818_read(r) | (mc146818_read(r + 1) << 8);
f0100cff:	8b 45 08             	mov    0x8(%ebp),%eax
f0100d02:	89 04 24             	mov    %eax,(%esp)
f0100d05:	e8 a2 16 00 00       	call   f01023ac <mc146818_read>
f0100d0a:	89 c3                	mov    %eax,%ebx
f0100d0c:	8b 45 08             	mov    0x8(%ebp),%eax
f0100d0f:	83 c0 01             	add    $0x1,%eax
f0100d12:	89 04 24             	mov    %eax,(%esp)
f0100d15:	e8 92 16 00 00       	call   f01023ac <mc146818_read>
f0100d1a:	c1 e0 08             	shl    $0x8,%eax
f0100d1d:	09 d8                	or     %ebx,%eax
}
f0100d1f:	83 c4 04             	add    $0x4,%esp
f0100d22:	5b                   	pop    %ebx
f0100d23:	5d                   	pop    %ebp
f0100d24:	c3                   	ret    

f0100d25 <i386_detect_memory>:

void
i386_detect_memory(void)
{
f0100d25:	55                   	push   %ebp
f0100d26:	89 e5                	mov    %esp,%ebp
f0100d28:	83 ec 28             	sub    $0x28,%esp
	// CMOS tells us how many kilobytes there are
	basemem = ROUNDDOWN(nvram_read(NVRAM_BASELO)*1024, PGSIZE);
f0100d2b:	c7 04 24 15 00 00 00 	movl   $0x15,(%esp)
f0100d32:	e8 c1 ff ff ff       	call   f0100cf8 <nvram_read>
f0100d37:	c1 e0 0a             	shl    $0xa,%eax
f0100d3a:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0100d3d:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100d40:	25 00 f0 ff ff       	and    $0xfffff000,%eax
f0100d45:	a3 0c 38 11 f0       	mov    %eax,0xf011380c
	extmem = ROUNDDOWN(nvram_read(NVRAM_EXTLO)*1024, PGSIZE);
f0100d4a:	c7 04 24 17 00 00 00 	movl   $0x17,(%esp)
f0100d51:	e8 a2 ff ff ff       	call   f0100cf8 <nvram_read>
f0100d56:	c1 e0 0a             	shl    $0xa,%eax
f0100d59:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0100d5c:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100d5f:	25 00 f0 ff ff       	and    $0xfffff000,%eax
f0100d64:	a3 10 38 11 f0       	mov    %eax,0xf0113810

	// Calculate the maxmium physical address based on whether
	// or not there is any extended memory.  See comment in ../inc/mmu.h.
	if (extmem)
f0100d69:	a1 10 38 11 f0       	mov    0xf0113810,%eax
f0100d6e:	85 c0                	test   %eax,%eax
f0100d70:	74 11                	je     f0100d83 <i386_detect_memory+0x5e>
		maxpa = EXTPHYSMEM + extmem;
f0100d72:	a1 10 38 11 f0       	mov    0xf0113810,%eax
f0100d77:	05 00 00 10 00       	add    $0x100000,%eax
f0100d7c:	a3 08 38 11 f0       	mov    %eax,0xf0113808
f0100d81:	eb 0a                	jmp    f0100d8d <i386_detect_memory+0x68>
	else
		maxpa = basemem;
f0100d83:	a1 0c 38 11 f0       	mov    0xf011380c,%eax
f0100d88:	a3 08 38 11 f0       	mov    %eax,0xf0113808

	npage = maxpa / PGSIZE;
f0100d8d:	a1 08 38 11 f0       	mov    0xf0113808,%eax
f0100d92:	c1 e8 0c             	shr    $0xc,%eax
f0100d95:	a3 20 3c 11 f0       	mov    %eax,0xf0113c20

	cprintf("Physical memory: %dK available, ", (int)(maxpa/1024));
f0100d9a:	a1 08 38 11 f0       	mov    0xf0113808,%eax
f0100d9f:	c1 e8 0a             	shr    $0xa,%eax
f0100da2:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100da6:	c7 04 24 fc 3a 10 f0 	movl   $0xf0103afc,(%esp)
f0100dad:	e8 b5 16 00 00       	call   f0102467 <cprintf>
	cprintf("base = %dK, extended = %dK\n", (int)(basemem/1024), (int)(extmem/1024));
f0100db2:	a1 10 38 11 f0       	mov    0xf0113810,%eax
f0100db7:	c1 e8 0a             	shr    $0xa,%eax
f0100dba:	89 c2                	mov    %eax,%edx
f0100dbc:	a1 0c 38 11 f0       	mov    0xf011380c,%eax
f0100dc1:	c1 e8 0a             	shr    $0xa,%eax
f0100dc4:	89 54 24 08          	mov    %edx,0x8(%esp)
f0100dc8:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100dcc:	c7 04 24 1d 3b 10 f0 	movl   $0xf0103b1d,(%esp)
f0100dd3:	e8 8f 16 00 00       	call   f0102467 <cprintf>
}
f0100dd8:	c9                   	leave  
f0100dd9:	c3                   	ret    

f0100dda <boot_alloc>:
// This function may ONLY be used during initialization,
// before the page_free_list has been set up.
// 
static void*
boot_alloc(uint32_t n, uint32_t align)
{
f0100dda:	55                   	push   %ebp
f0100ddb:	89 e5                	mov    %esp,%ebp
f0100ddd:	83 ec 18             	sub    $0x18,%esp
	// Initialize boot_freemem if this is the first time.
	// 'end' is a magic symbol automatically generated by the linker,
	// which points to the end of the kernel's bss segment -
	// i.e., the first virtual address that the linker
	// did _not_ assign to any kernel code or global variables.
	if (boot_freemem == 0)
f0100de0:	a1 14 38 11 f0       	mov    0xf0113814,%eax
f0100de5:	85 c0                	test   %eax,%eax
f0100de7:	75 0a                	jne    f0100df3 <boot_alloc+0x19>
		boot_freemem = end;
f0100de9:	c7 05 14 38 11 f0 30 	movl   $0xf0113c30,0xf0113814
f0100df0:	3c 11 f0 
	//	Step 1: round boot_freemem up to be aligned properly
	//	Step 2: save current value of boot_freemem as allocated chunk
	//	Step 3: increase boot_freemem to record allocation
	//	Step 4: return allocated chunk

	boot_freemem = ROUNDUP(boot_freemem, align);
f0100df3:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100df6:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0100df9:	8b 15 14 38 11 f0    	mov    0xf0113814,%edx
f0100dff:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100e02:	83 e8 01             	sub    $0x1,%eax
f0100e05:	8d 04 02             	lea    (%edx,%eax,1),%eax
f0100e08:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0100e0b:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100e0e:	89 45 e8             	mov    %eax,-0x18(%ebp)
f0100e11:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0100e14:	ba 00 00 00 00       	mov    $0x0,%edx
f0100e19:	f7 75 f8             	divl   -0x8(%ebp)
f0100e1c:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100e1f:	29 d0                	sub    %edx,%eax
f0100e21:	a3 14 38 11 f0       	mov    %eax,0xf0113814
	v = (void*)boot_freemem;
f0100e26:	a1 14 38 11 f0       	mov    0xf0113814,%eax
f0100e2b:	89 45 f4             	mov    %eax,-0xc(%ebp)
	boot_freemem += n;
f0100e2e:	a1 14 38 11 f0       	mov    0xf0113814,%eax
f0100e33:	03 45 08             	add    0x8(%ebp),%eax
f0100e36:	a3 14 38 11 f0       	mov    %eax,0xf0113814
	return v;
f0100e3b:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
f0100e3e:	c9                   	leave  
f0100e3f:	c3                   	ret    

f0100e40 <boot_pgdir_walk>:
// This function may ONLY be used during initialization,
// before the page_free_list has been set up.
//
static pte_t*
boot_pgdir_walk(pde_t *pgdir, uintptr_t la, int create)
{
f0100e40:	55                   	push   %ebp
f0100e41:	89 e5                	mov    %esp,%ebp
f0100e43:	83 ec 38             	sub    $0x38,%esp
	// Get the PDE for the LA
	pde_t *pde = &pgdir[PDX(la)];
f0100e46:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100e49:	c1 e8 16             	shr    $0x16,%eax
f0100e4c:	c1 e0 02             	shl    $0x2,%eax
f0100e4f:	03 45 08             	add    0x8(%ebp),%eax
f0100e52:	89 45 e8             	mov    %eax,-0x18(%ebp)

	// If the PT is present
	if (*pde & PTE_P) {
f0100e55:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0100e58:	8b 00                	mov    (%eax),%eax
f0100e5a:	83 e0 01             	and    $0x1,%eax
f0100e5d:	84 c0                	test   %al,%al
f0100e5f:	74 65                	je     f0100ec6 <boot_pgdir_walk+0x86>
		// Return a pointer to the PTE
		return (pte_t*)KADDR(PTE_ADDR(*pde)) + PTX(la);
f0100e61:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0100e64:	8b 00                	mov    (%eax),%eax
f0100e66:	25 00 f0 ff ff       	and    $0xfffff000,%eax
f0100e6b:	89 45 ec             	mov    %eax,-0x14(%ebp)
f0100e6e:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0100e71:	c1 e8 0c             	shr    $0xc,%eax
f0100e74:	89 45 f0             	mov    %eax,-0x10(%ebp)
f0100e77:	a1 20 3c 11 f0       	mov    0xf0113c20,%eax
f0100e7c:	39 45 f0             	cmp    %eax,-0x10(%ebp)
f0100e7f:	72 23                	jb     f0100ea4 <boot_pgdir_walk+0x64>
f0100e81:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0100e84:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0100e88:	c7 44 24 08 3c 3b 10 	movl   $0xf0103b3c,0x8(%esp)
f0100e8f:	f0 
f0100e90:	c7 44 24 04 9e 00 00 	movl   $0x9e,0x4(%esp)
f0100e97:	00 
f0100e98:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0100e9f:	e8 71 f2 ff ff       	call   f0100115 <_panic>
f0100ea4:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0100ea7:	2d 00 00 00 10       	sub    $0x10000000,%eax
f0100eac:	89 c2                	mov    %eax,%edx
f0100eae:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100eb1:	c1 e8 0c             	shr    $0xc,%eax
f0100eb4:	25 ff 03 00 00       	and    $0x3ff,%eax
f0100eb9:	c1 e0 02             	shl    $0x2,%eax
f0100ebc:	01 c2                	add    %eax,%edx
f0100ebe:	89 55 dc             	mov    %edx,-0x24(%ebp)
f0100ec1:	e9 aa 00 00 00       	jmp    f0100f70 <boot_pgdir_walk+0x130>
	} else {
		// If we need to create the PT
		if (create) {
f0100ec6:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0100eca:	0f 84 99 00 00 00    	je     f0100f69 <boot_pgdir_walk+0x129>
			// Allocate the PT
			pte_t *pt = (pte_t*)boot_alloc(PGSIZE, PGSIZE);
f0100ed0:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0100ed7:	00 
f0100ed8:	c7 04 24 00 10 00 00 	movl   $0x1000,(%esp)
f0100edf:	e8 f6 fe ff ff       	call   f0100dda <boot_alloc>
f0100ee4:	89 45 f4             	mov    %eax,-0xc(%ebp)
			memset(pt, 0, PGSIZE);
f0100ee7:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
f0100eee:	00 
f0100eef:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0100ef6:	00 
f0100ef7:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0100efa:	89 04 24             	mov    %eax,(%esp)
f0100efd:	e8 8e 23 00 00       	call   f0103290 <memset>
			void *ppt = (void*)PADDR(pt);
f0100f02:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0100f05:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0100f08:	81 7d fc ff ff ff ef 	cmpl   $0xefffffff,-0x4(%ebp)
f0100f0f:	77 23                	ja     f0100f34 <boot_pgdir_walk+0xf4>
f0100f11:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100f14:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0100f18:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0100f1f:	f0 
f0100f20:	c7 44 24 04 a5 00 00 	movl   $0xa5,0x4(%esp)
f0100f27:	00 
f0100f28:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0100f2f:	e8 e1 f1 ff ff       	call   f0100115 <_panic>
f0100f34:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100f37:	05 00 00 00 10       	add    $0x10000000,%eax
f0100f3c:	89 45 f8             	mov    %eax,-0x8(%ebp)
			*pde = PTE_ADDR(ppt)|PTE_W|PTE_P;
f0100f3f:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100f42:	25 00 f0 ff ff       	and    $0xfffff000,%eax
f0100f47:	89 c2                	mov    %eax,%edx
f0100f49:	83 ca 03             	or     $0x3,%edx
f0100f4c:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0100f4f:	89 10                	mov    %edx,(%eax)
			return (pt + PTX(la));
f0100f51:	8b 45 0c             	mov    0xc(%ebp),%eax
f0100f54:	c1 e8 0c             	shr    $0xc,%eax
f0100f57:	25 ff 03 00 00       	and    $0x3ff,%eax
f0100f5c:	c1 e0 02             	shl    $0x2,%eax
f0100f5f:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0100f62:	01 c2                	add    %eax,%edx
f0100f64:	89 55 dc             	mov    %edx,-0x24(%ebp)
f0100f67:	eb 07                	jmp    f0100f70 <boot_pgdir_walk+0x130>
		} else {
			return (pte_t*)0;
f0100f69:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
f0100f70:	8b 45 dc             	mov    -0x24(%ebp),%eax
		}
	}
}
f0100f73:	c9                   	leave  
f0100f74:	c3                   	ret    

f0100f75 <boot_map_segment>:
// This function may ONLY be used during initialization,
// before the page_free_list has been set up.
//
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, physaddr_t pa, int perm)
{
f0100f75:	55                   	push   %ebp
f0100f76:	89 e5                	mov    %esp,%ebp
f0100f78:	83 ec 28             	sub    $0x28,%esp
	int i;
	
	for (i = 0; i < size / PGSIZE; i++) {
f0100f7b:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
f0100f82:	eb 47                	jmp    f0100fcb <boot_map_segment+0x56>
		pte_t *pte = boot_pgdir_walk(pgdir, la + i * PGSIZE, 1);
f0100f84:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100f87:	c1 e0 0c             	shl    $0xc,%eax
f0100f8a:	03 45 0c             	add    0xc(%ebp),%eax
f0100f8d:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
f0100f94:	00 
f0100f95:	89 44 24 04          	mov    %eax,0x4(%esp)
f0100f99:	8b 45 08             	mov    0x8(%ebp),%eax
f0100f9c:	89 04 24             	mov    %eax,(%esp)
f0100f9f:	e8 9c fe ff ff       	call   f0100e40 <boot_pgdir_walk>
f0100fa4:	89 45 fc             	mov    %eax,-0x4(%ebp)
		*pte = PTE_ADDR(pa + i * PGSIZE)|perm|PTE_P;
f0100fa7:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100faa:	c1 e0 0c             	shl    $0xc,%eax
f0100fad:	03 45 14             	add    0x14(%ebp),%eax
f0100fb0:	89 c2                	mov    %eax,%edx
f0100fb2:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
f0100fb8:	8b 45 18             	mov    0x18(%ebp),%eax
f0100fbb:	09 d0                	or     %edx,%eax
f0100fbd:	89 c2                	mov    %eax,%edx
f0100fbf:	83 ca 01             	or     $0x1,%edx
f0100fc2:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0100fc5:	89 10                	mov    %edx,(%eax)
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, physaddr_t pa, int perm)
{
	int i;
	
	for (i = 0; i < size / PGSIZE; i++) {
f0100fc7:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
f0100fcb:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0100fce:	8b 55 10             	mov    0x10(%ebp),%edx
f0100fd1:	c1 ea 0c             	shr    $0xc,%edx
f0100fd4:	39 d0                	cmp    %edx,%eax
f0100fd6:	72 ac                	jb     f0100f84 <boot_map_segment+0xf>
		pte_t *pte = boot_pgdir_walk(pgdir, la + i * PGSIZE, 1);
		*pte = PTE_ADDR(pa + i * PGSIZE)|perm|PTE_P;
	}
}
f0100fd8:	c9                   	leave  
f0100fd9:	c3                   	ret    

f0100fda <i386_vm_init>:
//
// From UTOP to ULIM, the user is allowed to read but not write.
// Above ULIM the user cannot read (or write). 
void
i386_vm_init(void)
{
f0100fda:	55                   	push   %ebp
f0100fdb:	89 e5                	mov    %esp,%ebp
f0100fdd:	83 ec 68             	sub    $0x68,%esp
	// Remove this line when you're ready to test this function.
	//~ panic("i386_vm_init: This function is not finished\n");

	//////////////////////////////////////////////////////////////////////
	// create initial page directory.
	pgdir = boot_alloc(PGSIZE, PGSIZE);
f0100fe0:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0100fe7:	00 
f0100fe8:	c7 04 24 00 10 00 00 	movl   $0x1000,(%esp)
f0100fef:	e8 e6 fd ff ff       	call   f0100dda <boot_alloc>
f0100ff4:	89 45 c4             	mov    %eax,-0x3c(%ebp)
	memset(pgdir, 0, PGSIZE);
f0100ff7:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
f0100ffe:	00 
f0100fff:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0101006:	00 
f0101007:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f010100a:	89 04 24             	mov    %eax,(%esp)
f010100d:	e8 7e 22 00 00       	call   f0103290 <memset>
	boot_pgdir = pgdir;
f0101012:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f0101015:	a3 28 3c 11 f0       	mov    %eax,0xf0113c28
	boot_cr3 = PADDR(pgdir);
f010101a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f010101d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
f0101020:	81 7d d4 ff ff ff ef 	cmpl   $0xefffffff,-0x2c(%ebp)
f0101027:	77 23                	ja     f010104c <i386_vm_init+0x72>
f0101029:	8b 45 d4             	mov    -0x2c(%ebp),%eax
f010102c:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0101030:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0101037:	f0 
f0101038:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
f010103f:	00 
f0101040:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101047:	e8 c9 f0 ff ff       	call   f0100115 <_panic>
f010104c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
f010104f:	05 00 00 00 10       	add    $0x10000000,%eax
f0101054:	a3 24 3c 11 f0       	mov    %eax,0xf0113c24
	// a virtual page table at virtual address VPT.
	// (For now, you don't have understand the greater purpose of the
	// following two lines.)

	// Permissions: kernel RW, user NONE
	pgdir[PDX(VPT)] = PADDR(pgdir)|PTE_W|PTE_P;
f0101059:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f010105c:	05 fc 0e 00 00       	add    $0xefc,%eax
f0101061:	89 45 b8             	mov    %eax,-0x48(%ebp)
f0101064:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f0101067:	89 45 d8             	mov    %eax,-0x28(%ebp)
f010106a:	81 7d d8 ff ff ff ef 	cmpl   $0xefffffff,-0x28(%ebp)
f0101071:	77 23                	ja     f0101096 <i386_vm_init+0xbc>
f0101073:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0101076:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010107a:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0101081:	f0 
f0101082:	c7 44 24 04 e5 00 00 	movl   $0xe5,0x4(%esp)
f0101089:	00 
f010108a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101091:	e8 7f f0 ff ff       	call   f0100115 <_panic>
f0101096:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0101099:	05 00 00 00 10       	add    $0x10000000,%eax
f010109e:	83 c8 03             	or     $0x3,%eax
f01010a1:	8b 55 b8             	mov    -0x48(%ebp),%edx
f01010a4:	89 02                	mov    %eax,(%edx)

	// same for UVPT
	// Permissions: kernel R, user R 
	pgdir[PDX(UVPT)] = PADDR(pgdir)|PTE_U|PTE_P;
f01010a6:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f01010a9:	05 f4 0e 00 00       	add    $0xef4,%eax
f01010ae:	89 45 bc             	mov    %eax,-0x44(%ebp)
f01010b1:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f01010b4:	89 45 dc             	mov    %eax,-0x24(%ebp)
f01010b7:	81 7d dc ff ff ff ef 	cmpl   $0xefffffff,-0x24(%ebp)
f01010be:	77 23                	ja     f01010e3 <i386_vm_init+0x109>
f01010c0:	8b 45 dc             	mov    -0x24(%ebp),%eax
f01010c3:	89 44 24 0c          	mov    %eax,0xc(%esp)
f01010c7:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f01010ce:	f0 
f01010cf:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
f01010d6:	00 
f01010d7:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01010de:	e8 32 f0 ff ff       	call   f0100115 <_panic>
f01010e3:	8b 45 dc             	mov    -0x24(%ebp),%eax
f01010e6:	05 00 00 00 10       	add    $0x10000000,%eax
f01010eb:	83 c8 05             	or     $0x5,%eax
f01010ee:	8b 55 bc             	mov    -0x44(%ebp),%edx
f01010f1:	89 02                	mov    %eax,(%edx)
	//     * [KSTACKTOP-KSTKSIZE, KSTACKTOP) -- backed by physical memory
	//     * [KSTACKTOP-PTSIZE, KSTACKTOP-KSTKSIZE) -- not backed => faults
	//     Permissions: kernel RW, user NONE
	// Your code goes here:

	boot_map_segment(pgdir, KSTACKTOP-KSTKSIZE, KSTKSIZE, PADDR(bootstack), PTE_W); 
f01010f3:	c7 45 e0 00 b0 10 f0 	movl   $0xf010b000,-0x20(%ebp)
f01010fa:	81 7d e0 ff ff ff ef 	cmpl   $0xefffffff,-0x20(%ebp)
f0101101:	77 23                	ja     f0101126 <i386_vm_init+0x14c>
f0101103:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0101106:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010110a:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0101111:	f0 
f0101112:	c7 44 24 04 f4 00 00 	movl   $0xf4,0x4(%esp)
f0101119:	00 
f010111a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101121:	e8 ef ef ff ff       	call   f0100115 <_panic>
f0101126:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0101129:	05 00 00 00 10       	add    $0x10000000,%eax
f010112e:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
f0101135:	00 
f0101136:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010113a:	c7 44 24 08 00 80 00 	movl   $0x8000,0x8(%esp)
f0101141:	00 
f0101142:	c7 44 24 04 00 80 bf 	movl   $0xefbf8000,0x4(%esp)
f0101149:	ef 
f010114a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f010114d:	89 04 24             	mov    %eax,(%esp)
f0101150:	e8 20 fe ff ff       	call   f0100f75 <boot_map_segment>
	// We might not have 2^32 - KERNBASE bytes of physical memory, but
	// we just set up the mapping anyway.
	// Permissions: kernel RW, user NONE
	// Your code goes here:

	boot_map_segment(pgdir, KERNBASE, 0xFFFFFFFF - KERNBASE + 1, 0, PTE_W);
f0101155:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
f010115c:	00 
f010115d:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101164:	00 
f0101165:	c7 44 24 08 00 00 00 	movl   $0x10000000,0x8(%esp)
f010116c:	10 
f010116d:	c7 44 24 04 00 00 00 	movl   $0xf0000000,0x4(%esp)
f0101174:	f0 
f0101175:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f0101178:	89 04 24             	mov    %eax,(%esp)
f010117b:	e8 f5 fd ff ff       	call   f0100f75 <boot_map_segment>
	// Permissions:
	//    - pages -- kernel RW, user NONE
	//    - the image mapped at UPAGES  -- kernel R, user R
	// Your code goes here: 

	size_t spages = ROUNDUP(npage * sizeof(struct Page), PGSIZE);
f0101180:	c7 45 e4 00 10 00 00 	movl   $0x1000,-0x1c(%ebp)
f0101187:	8b 15 20 3c 11 f0    	mov    0xf0113c20,%edx
f010118d:	89 d0                	mov    %edx,%eax
f010118f:	01 c0                	add    %eax,%eax
f0101191:	01 d0                	add    %edx,%eax
f0101193:	c1 e0 02             	shl    $0x2,%eax
f0101196:	03 45 e4             	add    -0x1c(%ebp),%eax
f0101199:	83 e8 01             	sub    $0x1,%eax
f010119c:	89 45 e8             	mov    %eax,-0x18(%ebp)
f010119f:	8b 45 e8             	mov    -0x18(%ebp),%eax
f01011a2:	89 45 b0             	mov    %eax,-0x50(%ebp)
f01011a5:	8b 45 b0             	mov    -0x50(%ebp),%eax
f01011a8:	ba 00 00 00 00       	mov    $0x0,%edx
f01011ad:	f7 75 e4             	divl   -0x1c(%ebp)
f01011b0:	8b 45 e8             	mov    -0x18(%ebp),%eax
f01011b3:	29 d0                	sub    %edx,%eax
f01011b5:	89 45 cc             	mov    %eax,-0x34(%ebp)
	pages = (struct Page*)boot_alloc(spages, PGSIZE);
f01011b8:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f01011bf:	00 
f01011c0:	8b 45 cc             	mov    -0x34(%ebp),%eax
f01011c3:	89 04 24             	mov    %eax,(%esp)
f01011c6:	e8 0f fc ff ff       	call   f0100dda <boot_alloc>
f01011cb:	a3 2c 3c 11 f0       	mov    %eax,0xf0113c2c
	physaddr_t ppages = PADDR(pages);
f01011d0:	a1 2c 3c 11 f0       	mov    0xf0113c2c,%eax
f01011d5:	89 45 ec             	mov    %eax,-0x14(%ebp)
f01011d8:	81 7d ec ff ff ff ef 	cmpl   $0xefffffff,-0x14(%ebp)
f01011df:	77 23                	ja     f0101204 <i386_vm_init+0x22a>
f01011e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
f01011e4:	89 44 24 0c          	mov    %eax,0xc(%esp)
f01011e8:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f01011ef:	f0 
f01011f0:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
f01011f7:	00 
f01011f8:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01011ff:	e8 11 ef ff ff       	call   f0100115 <_panic>
f0101204:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101207:	05 00 00 00 10       	add    $0x10000000,%eax
f010120c:	89 45 d0             	mov    %eax,-0x30(%ebp)
	boot_map_segment(pgdir, UPAGES, spages, ppages, PTE_U);
f010120f:	c7 44 24 10 04 00 00 	movl   $0x4,0x10(%esp)
f0101216:	00 
f0101217:	8b 45 d0             	mov    -0x30(%ebp),%eax
f010121a:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010121e:	8b 45 cc             	mov    -0x34(%ebp),%eax
f0101221:	89 44 24 08          	mov    %eax,0x8(%esp)
f0101225:	c7 44 24 04 00 00 00 	movl   $0xef000000,0x4(%esp)
f010122c:	ef 
f010122d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f0101230:	89 04 24             	mov    %eax,(%esp)
f0101233:	e8 3d fd ff ff       	call   f0100f75 <boot_map_segment>
	
	// Check that the initial page directory has been set up correctly.
	check_boot_pgdir();
f0101238:	e8 92 00 00 00       	call   f01012cf <check_boot_pgdir>
	// mapping, even though we are turning on paging and reconfiguring
	// segmentation.

	// Map VA 0:4MB same as VA KERNBASE, i.e. to PA 0:4MB.
	// (Limits our kernel to <4MB)
	pgdir[0] = pgdir[PDX(KERNBASE)];
f010123d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f0101240:	05 00 0f 00 00       	add    $0xf00,%eax
f0101245:	8b 10                	mov    (%eax),%edx
f0101247:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f010124a:	89 10                	mov    %edx,(%eax)

	// Install page table.
	lcr3(boot_cr3);
f010124c:	a1 24 3c 11 f0       	mov    0xf0113c24,%eax
f0101251:	89 45 f0             	mov    %eax,-0x10(%ebp)
}

static __inline void
lcr3(uint32_t val)
{
	__asm __volatile("movl %0,%%cr3" : : "r" (val));
f0101254:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101257:	0f 22 d8             	mov    %eax,%cr3

static __inline uint32_t
rcr0(void)
{
	uint32_t val;
	__asm __volatile("movl %%cr0,%0" : "=r" (val));
f010125a:	0f 20 c0             	mov    %cr0,%eax
f010125d:	89 45 f4             	mov    %eax,-0xc(%ebp)
	return val;
f0101260:	8b 45 f4             	mov    -0xc(%ebp),%eax

	// Turn on paging.
	cr0 = rcr0();
f0101263:	89 45 c8             	mov    %eax,-0x38(%ebp)
	cr0 |= CR0_PE|CR0_PG|CR0_AM|CR0_WP|CR0_NE|CR0_TS|CR0_EM|CR0_MP;
f0101266:	81 4d c8 2f 00 05 80 	orl    $0x8005002f,-0x38(%ebp)
	cr0 &= ~(CR0_TS|CR0_EM);
f010126d:	83 65 c8 f3          	andl   $0xfffffff3,-0x38(%ebp)
f0101271:	8b 45 c8             	mov    -0x38(%ebp),%eax
f0101274:	89 45 f8             	mov    %eax,-0x8(%ebp)
}

static __inline void
lcr0(uint32_t val)
{
	__asm __volatile("movl %0,%%cr0" : : "r" (val));
f0101277:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010127a:	0f 22 c0             	mov    %eax,%cr0

	// Current mapping: KERNBASE+x => x => x.
	// (x < 4MB so uses paging pgdir[0])

	// Reload all segment registers.
	asm volatile("lgdt gdt_pd+2");
f010127d:	0f 01 15 b2 35 11 f0 	lgdtl  0xf01135b2
	asm volatile("movw %%ax,%%gs" :: "a" (GD_UD|3));
f0101284:	b8 23 00 00 00       	mov    $0x23,%eax
f0101289:	8e e8                	mov    %eax,%gs
	asm volatile("movw %%ax,%%fs" :: "a" (GD_UD|3));
f010128b:	b8 23 00 00 00       	mov    $0x23,%eax
f0101290:	8e e0                	mov    %eax,%fs
	asm volatile("movw %%ax,%%es" :: "a" (GD_KD));
f0101292:	b8 10 00 00 00       	mov    $0x10,%eax
f0101297:	8e c0                	mov    %eax,%es
	asm volatile("movw %%ax,%%ds" :: "a" (GD_KD));
f0101299:	b8 10 00 00 00       	mov    $0x10,%eax
f010129e:	8e d8                	mov    %eax,%ds
	asm volatile("movw %%ax,%%ss" :: "a" (GD_KD));
f01012a0:	b8 10 00 00 00       	mov    $0x10,%eax
f01012a5:	8e d0                	mov    %eax,%ss
	asm volatile("ljmp %0,$1f\n 1:\n" :: "i" (GD_KT));  // reload cs
f01012a7:	ea ae 12 10 f0 08 00 	ljmp   $0x8,$0xf01012ae
	asm volatile("lldt %%ax" :: "a" (0));
f01012ae:	b8 00 00 00 00       	mov    $0x0,%eax
f01012b3:	0f 00 d0             	lldt   %ax

	// Final mapping: KERNBASE+x => KERNBASE+x => x.

	// This mapping was only used after paging was turned on but
	// before the segment registers were reloaded.
	pgdir[0] = 0;
f01012b6:	8b 45 c4             	mov    -0x3c(%ebp),%eax
f01012b9:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

	// Flush the TLB for good measure, to kill the pgdir[0] mapping.
	lcr3(boot_cr3);
f01012bf:	a1 24 3c 11 f0       	mov    0xf0113c24,%eax
f01012c4:	89 45 fc             	mov    %eax,-0x4(%ebp)
}

static __inline void
lcr3(uint32_t val)
{
	__asm __volatile("movl %0,%%cr3" : : "r" (val));
f01012c7:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01012ca:	0f 22 d8             	mov    %eax,%cr3
}
f01012cd:	c9                   	leave  
f01012ce:	c3                   	ret    

f01012cf <check_boot_pgdir>:
//
static physaddr_t check_va2pa(pde_t *pgdir, uintptr_t va);

static void
check_boot_pgdir(void)
{
f01012cf:	55                   	push   %ebp
f01012d0:	89 e5                	mov    %esp,%ebp
f01012d2:	83 ec 48             	sub    $0x48,%esp
	uint32_t i, n;
	pde_t *pgdir;

	pgdir = boot_pgdir;
f01012d5:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f01012da:	89 45 ec             	mov    %eax,-0x14(%ebp)

	// check pages array
	n = ROUNDUP(npage*sizeof(struct Page), PGSIZE);
f01012dd:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
f01012e4:	8b 15 20 3c 11 f0    	mov    0xf0113c20,%edx
f01012ea:	89 d0                	mov    %edx,%eax
f01012ec:	01 c0                	add    %eax,%eax
f01012ee:	01 d0                	add    %edx,%eax
f01012f0:	c1 e0 02             	shl    $0x2,%eax
f01012f3:	03 45 f0             	add    -0x10(%ebp),%eax
f01012f6:	83 e8 01             	sub    $0x1,%eax
f01012f9:	89 45 f4             	mov    %eax,-0xc(%ebp)
f01012fc:	8b 45 f4             	mov    -0xc(%ebp),%eax
f01012ff:	89 45 d0             	mov    %eax,-0x30(%ebp)
f0101302:	8b 45 d0             	mov    -0x30(%ebp),%eax
f0101305:	ba 00 00 00 00       	mov    $0x0,%edx
f010130a:	f7 75 f0             	divl   -0x10(%ebp)
f010130d:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101310:	29 d0                	sub    %edx,%eax
f0101312:	89 45 e8             	mov    %eax,-0x18(%ebp)
	for (i = 0; i < n; i += PGSIZE)
f0101315:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
f010131c:	e9 89 00 00 00       	jmp    f01013aa <check_boot_pgdir+0xdb>
		assert(check_va2pa(pgdir, UPAGES + i) == PADDR(pages) + i);
f0101321:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0101324:	2d 00 00 00 11       	sub    $0x11000000,%eax
f0101329:	89 44 24 04          	mov    %eax,0x4(%esp)
f010132d:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101330:	89 04 24             	mov    %eax,(%esp)
f0101333:	e8 56 02 00 00       	call   f010158e <check_va2pa>
f0101338:	89 45 d8             	mov    %eax,-0x28(%ebp)
f010133b:	a1 2c 3c 11 f0       	mov    0xf0113c2c,%eax
f0101340:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0101343:	81 7d f8 ff ff ff ef 	cmpl   $0xefffffff,-0x8(%ebp)
f010134a:	77 23                	ja     f010136f <check_boot_pgdir+0xa0>
f010134c:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010134f:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0101353:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f010135a:	f0 
f010135b:	c7 44 24 04 5d 01 00 	movl   $0x15d,0x4(%esp)
f0101362:	00 
f0101363:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f010136a:	e8 a6 ed ff ff       	call   f0100115 <_panic>
f010136f:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0101372:	05 00 00 00 10       	add    $0x10000000,%eax
f0101377:	03 45 e4             	add    -0x1c(%ebp),%eax
f010137a:	39 45 d8             	cmp    %eax,-0x28(%ebp)
f010137d:	74 24                	je     f01013a3 <check_boot_pgdir+0xd4>
f010137f:	c7 44 24 0c 90 3b 10 	movl   $0xf0103b90,0xc(%esp)
f0101386:	f0 
f0101387:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f010138e:	f0 
f010138f:	c7 44 24 04 5d 01 00 	movl   $0x15d,0x4(%esp)
f0101396:	00 
f0101397:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f010139e:	e8 72 ed ff ff       	call   f0100115 <_panic>

	pgdir = boot_pgdir;

	// check pages array
	n = ROUNDUP(npage*sizeof(struct Page), PGSIZE);
	for (i = 0; i < n; i += PGSIZE)
f01013a3:	81 45 e4 00 10 00 00 	addl   $0x1000,-0x1c(%ebp)
f01013aa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f01013ad:	3b 45 e8             	cmp    -0x18(%ebp),%eax
f01013b0:	0f 82 6b ff ff ff    	jb     f0101321 <check_boot_pgdir+0x52>
		assert(check_va2pa(pgdir, UPAGES + i) == PADDR(pages) + i);

	// check phys mem
	for (i = 0; KERNBASE + i != 0; i += PGSIZE)
f01013b6:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
f01013bd:	eb 47                	jmp    f0101406 <check_boot_pgdir+0x137>
		assert(check_va2pa(pgdir, KERNBASE + i) == i);
f01013bf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f01013c2:	2d 00 00 00 10       	sub    $0x10000000,%eax
f01013c7:	89 44 24 04          	mov    %eax,0x4(%esp)
f01013cb:	8b 45 ec             	mov    -0x14(%ebp),%eax
f01013ce:	89 04 24             	mov    %eax,(%esp)
f01013d1:	e8 b8 01 00 00       	call   f010158e <check_va2pa>
f01013d6:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
f01013d9:	74 24                	je     f01013ff <check_boot_pgdir+0x130>
f01013db:	c7 44 24 0c d8 3b 10 	movl   $0xf0103bd8,0xc(%esp)
f01013e2:	f0 
f01013e3:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01013ea:	f0 
f01013eb:	c7 44 24 04 61 01 00 	movl   $0x161,0x4(%esp)
f01013f2:	00 
f01013f3:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01013fa:	e8 16 ed ff ff       	call   f0100115 <_panic>
	n = ROUNDUP(npage*sizeof(struct Page), PGSIZE);
	for (i = 0; i < n; i += PGSIZE)
		assert(check_va2pa(pgdir, UPAGES + i) == PADDR(pages) + i);

	// check phys mem
	for (i = 0; KERNBASE + i != 0; i += PGSIZE)
f01013ff:	81 45 e4 00 10 00 00 	addl   $0x1000,-0x1c(%ebp)
f0101406:	81 7d e4 00 00 00 10 	cmpl   $0x10000000,-0x1c(%ebp)
f010140d:	75 b0                	jne    f01013bf <check_boot_pgdir+0xf0>
		assert(check_va2pa(pgdir, KERNBASE + i) == i);

	// check kernel stack
	for (i = 0; i < KSTKSIZE; i += PGSIZE)
f010140f:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
f0101416:	e9 88 00 00 00       	jmp    f01014a3 <check_boot_pgdir+0x1d4>
		assert(check_va2pa(pgdir, KSTACKTOP - KSTKSIZE + i) == PADDR(bootstack) + i);
f010141b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f010141e:	2d 00 80 40 10       	sub    $0x10408000,%eax
f0101423:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101427:	8b 45 ec             	mov    -0x14(%ebp),%eax
f010142a:	89 04 24             	mov    %eax,(%esp)
f010142d:	e8 5c 01 00 00       	call   f010158e <check_va2pa>
f0101432:	89 45 dc             	mov    %eax,-0x24(%ebp)
f0101435:	c7 45 fc 00 b0 10 f0 	movl   $0xf010b000,-0x4(%ebp)
f010143c:	81 7d fc ff ff ff ef 	cmpl   $0xefffffff,-0x4(%ebp)
f0101443:	77 23                	ja     f0101468 <check_boot_pgdir+0x199>
f0101445:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0101448:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010144c:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0101453:	f0 
f0101454:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
f010145b:	00 
f010145c:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101463:	e8 ad ec ff ff       	call   f0100115 <_panic>
f0101468:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010146b:	05 00 00 00 10       	add    $0x10000000,%eax
f0101470:	03 45 e4             	add    -0x1c(%ebp),%eax
f0101473:	39 45 dc             	cmp    %eax,-0x24(%ebp)
f0101476:	74 24                	je     f010149c <check_boot_pgdir+0x1cd>
f0101478:	c7 44 24 0c 00 3c 10 	movl   $0xf0103c00,0xc(%esp)
f010147f:	f0 
f0101480:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101487:	f0 
f0101488:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
f010148f:	00 
f0101490:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101497:	e8 79 ec ff ff       	call   f0100115 <_panic>
	// check phys mem
	for (i = 0; KERNBASE + i != 0; i += PGSIZE)
		assert(check_va2pa(pgdir, KERNBASE + i) == i);

	// check kernel stack
	for (i = 0; i < KSTKSIZE; i += PGSIZE)
f010149c:	81 45 e4 00 10 00 00 	addl   $0x1000,-0x1c(%ebp)
f01014a3:	81 7d e4 ff 7f 00 00 	cmpl   $0x7fff,-0x1c(%ebp)
f01014aa:	0f 86 6b ff ff ff    	jbe    f010141b <check_boot_pgdir+0x14c>
		assert(check_va2pa(pgdir, KSTACKTOP - KSTKSIZE + i) == PADDR(bootstack) + i);

	// check for zero/non-zero in PDEs
	for (i = 0; i < NPDENTRIES; i++) {
f01014b0:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
f01014b7:	e9 b7 00 00 00       	jmp    f0101573 <check_boot_pgdir+0x2a4>
		switch (i) {
f01014bc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f01014bf:	2d bc 03 00 00       	sub    $0x3bc,%eax
f01014c4:	83 f8 03             	cmp    $0x3,%eax
f01014c7:	77 37                	ja     f0101500 <check_boot_pgdir+0x231>
		case PDX(VPT):
		case PDX(UVPT):
		case PDX(KSTACKTOP-1):
		case PDX(UPAGES):
			assert(pgdir[i]);
f01014c9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f01014cc:	c1 e0 02             	shl    $0x2,%eax
f01014cf:	03 45 ec             	add    -0x14(%ebp),%eax
f01014d2:	8b 00                	mov    (%eax),%eax
f01014d4:	85 c0                	test   %eax,%eax
f01014d6:	0f 85 93 00 00 00    	jne    f010156f <check_boot_pgdir+0x2a0>
f01014dc:	c7 44 24 0c 45 3c 10 	movl   $0xf0103c45,0xc(%esp)
f01014e3:	f0 
f01014e4:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01014eb:	f0 
f01014ec:	c7 44 24 04 6e 01 00 	movl   $0x16e,0x4(%esp)
f01014f3:	00 
f01014f4:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01014fb:	e8 15 ec ff ff       	call   f0100115 <_panic>
			break;
		default:
			if (i >= PDX(KERNBASE))
f0101500:	81 7d e4 bf 03 00 00 	cmpl   $0x3bf,-0x1c(%ebp)
f0101507:	76 33                	jbe    f010153c <check_boot_pgdir+0x26d>
				assert(pgdir[i]);
f0101509:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f010150c:	c1 e0 02             	shl    $0x2,%eax
f010150f:	03 45 ec             	add    -0x14(%ebp),%eax
f0101512:	8b 00                	mov    (%eax),%eax
f0101514:	85 c0                	test   %eax,%eax
f0101516:	75 57                	jne    f010156f <check_boot_pgdir+0x2a0>
f0101518:	c7 44 24 0c 45 3c 10 	movl   $0xf0103c45,0xc(%esp)
f010151f:	f0 
f0101520:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101527:	f0 
f0101528:	c7 44 24 04 72 01 00 	movl   $0x172,0x4(%esp)
f010152f:	00 
f0101530:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101537:	e8 d9 eb ff ff       	call   f0100115 <_panic>
			else
				assert(pgdir[i] == 0);
f010153c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f010153f:	c1 e0 02             	shl    $0x2,%eax
f0101542:	03 45 ec             	add    -0x14(%ebp),%eax
f0101545:	8b 00                	mov    (%eax),%eax
f0101547:	85 c0                	test   %eax,%eax
f0101549:	74 24                	je     f010156f <check_boot_pgdir+0x2a0>
f010154b:	c7 44 24 0c 4e 3c 10 	movl   $0xf0103c4e,0xc(%esp)
f0101552:	f0 
f0101553:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f010155a:	f0 
f010155b:	c7 44 24 04 74 01 00 	movl   $0x174,0x4(%esp)
f0101562:	00 
f0101563:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f010156a:	e8 a6 eb ff ff       	call   f0100115 <_panic>
	// check kernel stack
	for (i = 0; i < KSTKSIZE; i += PGSIZE)
		assert(check_va2pa(pgdir, KSTACKTOP - KSTKSIZE + i) == PADDR(bootstack) + i);

	// check for zero/non-zero in PDEs
	for (i = 0; i < NPDENTRIES; i++) {
f010156f:	83 45 e4 01          	addl   $0x1,-0x1c(%ebp)
f0101573:	81 7d e4 ff 03 00 00 	cmpl   $0x3ff,-0x1c(%ebp)
f010157a:	0f 86 3c ff ff ff    	jbe    f01014bc <check_boot_pgdir+0x1ed>
			else
				assert(pgdir[i] == 0);
			break;
		}
	}
	cprintf("check_boot_pgdir() succeeded!\n");
f0101580:	c7 04 24 5c 3c 10 f0 	movl   $0xf0103c5c,(%esp)
f0101587:	e8 db 0e 00 00       	call   f0102467 <cprintf>
}
f010158c:	c9                   	leave  
f010158d:	c3                   	ret    

f010158e <check_va2pa>:
// this functionality for us!  We define our own version to help check
// the check_boot_pgdir() function; it shouldn't be used elsewhere.

static physaddr_t
check_va2pa(pde_t *pgdir, uintptr_t va)
{
f010158e:	55                   	push   %ebp
f010158f:	89 e5                	mov    %esp,%ebp
f0101591:	83 ec 28             	sub    $0x28,%esp
	pte_t *p;

	pgdir = &pgdir[PDX(va)];
f0101594:	8b 45 0c             	mov    0xc(%ebp),%eax
f0101597:	c1 e8 16             	shr    $0x16,%eax
f010159a:	c1 e0 02             	shl    $0x2,%eax
f010159d:	01 45 08             	add    %eax,0x8(%ebp)
	if (!(*pgdir & PTE_P))
f01015a0:	8b 45 08             	mov    0x8(%ebp),%eax
f01015a3:	8b 00                	mov    (%eax),%eax
f01015a5:	83 e0 01             	and    $0x1,%eax
f01015a8:	85 c0                	test   %eax,%eax
f01015aa:	75 0c                	jne    f01015b8 <check_va2pa+0x2a>
		return ~0;
f01015ac:	c7 45 ec ff ff ff ff 	movl   $0xffffffff,-0x14(%ebp)
f01015b3:	e9 8f 00 00 00       	jmp    f0101647 <check_va2pa+0xb9>
	p = (pte_t*) KADDR(PTE_ADDR(*pgdir));
f01015b8:	8b 45 08             	mov    0x8(%ebp),%eax
f01015bb:	8b 00                	mov    (%eax),%eax
f01015bd:	25 00 f0 ff ff       	and    $0xfffff000,%eax
f01015c2:	89 45 f8             	mov    %eax,-0x8(%ebp)
f01015c5:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01015c8:	c1 e8 0c             	shr    $0xc,%eax
f01015cb:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01015ce:	a1 20 3c 11 f0       	mov    0xf0113c20,%eax
f01015d3:	39 45 fc             	cmp    %eax,-0x4(%ebp)
f01015d6:	72 23                	jb     f01015fb <check_va2pa+0x6d>
f01015d8:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01015db:	89 44 24 0c          	mov    %eax,0xc(%esp)
f01015df:	c7 44 24 08 3c 3b 10 	movl   $0xf0103b3c,0x8(%esp)
f01015e6:	f0 
f01015e7:	c7 44 24 04 88 01 00 	movl   $0x188,0x4(%esp)
f01015ee:	00 
f01015ef:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01015f6:	e8 1a eb ff ff       	call   f0100115 <_panic>
f01015fb:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01015fe:	2d 00 00 00 10       	sub    $0x10000000,%eax
f0101603:	89 45 f4             	mov    %eax,-0xc(%ebp)
	if (!(p[PTX(va)] & PTE_P))
f0101606:	8b 45 0c             	mov    0xc(%ebp),%eax
f0101609:	c1 e8 0c             	shr    $0xc,%eax
f010160c:	25 ff 03 00 00       	and    $0x3ff,%eax
f0101611:	c1 e0 02             	shl    $0x2,%eax
f0101614:	03 45 f4             	add    -0xc(%ebp),%eax
f0101617:	8b 00                	mov    (%eax),%eax
f0101619:	83 e0 01             	and    $0x1,%eax
f010161c:	85 c0                	test   %eax,%eax
f010161e:	75 09                	jne    f0101629 <check_va2pa+0x9b>
		return ~0;
f0101620:	c7 45 ec ff ff ff ff 	movl   $0xffffffff,-0x14(%ebp)
f0101627:	eb 1e                	jmp    f0101647 <check_va2pa+0xb9>
	return PTE_ADDR(p[PTX(va)]);
f0101629:	8b 45 0c             	mov    0xc(%ebp),%eax
f010162c:	c1 e8 0c             	shr    $0xc,%eax
f010162f:	25 ff 03 00 00       	and    $0x3ff,%eax
f0101634:	c1 e0 02             	shl    $0x2,%eax
f0101637:	03 45 f4             	add    -0xc(%ebp),%eax
f010163a:	8b 00                	mov    (%eax),%eax
f010163c:	89 c2                	mov    %eax,%edx
f010163e:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
f0101644:	89 55 ec             	mov    %edx,-0x14(%ebp)
f0101647:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f010164a:	c9                   	leave  
f010164b:	c3                   	ret    

f010164c <page_init>:
// to allocate and deallocate physical memory via the page_free_list,
// and NEVER use boot_alloc() or the related boot-time functions above.
//
void
page_init(void)
{
f010164c:	55                   	push   %ebp
f010164d:	89 e5                	mov    %esp,%ebp
f010164f:	53                   	push   %ebx
f0101650:	83 ec 34             	sub    $0x34,%esp
	//
	// Change the code to reflect this.

	int i;
	extern char end[];
	LIST_INIT(&page_free_list);
f0101653:	c7 05 18 38 11 f0 00 	movl   $0x0,0xf0113818
f010165a:	00 00 00 

	size_t nbasepages = IOPHYSMEM / PGSIZE;
f010165d:	c7 45 e4 a0 00 00 00 	movl   $0xa0,-0x1c(%ebp)
	size_t ntotalbasepages = EXTPHYSMEM / PGSIZE;
f0101664:	c7 45 e8 00 01 00 00 	movl   $0x100,-0x18(%ebp)

	physaddr_t kernbase =  PADDR(0xF0100000);
f010166b:	c7 45 f4 00 00 10 f0 	movl   $0xf0100000,-0xc(%ebp)
f0101672:	81 7d f4 ff ff ff ef 	cmpl   $0xefffffff,-0xc(%ebp)
f0101679:	77 23                	ja     f010169e <page_init+0x52>
f010167b:	8b 45 f4             	mov    -0xc(%ebp),%eax
f010167e:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0101682:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f0101689:	f0 
f010168a:	c7 44 24 04 b2 01 00 	movl   $0x1b2,0x4(%esp)
f0101691:	00 
f0101692:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101699:	e8 77 ea ff ff       	call   f0100115 <_panic>
f010169e:	8b 45 f4             	mov    -0xc(%ebp),%eax
f01016a1:	05 00 00 00 10       	add    $0x10000000,%eax
f01016a6:	89 45 ec             	mov    %eax,-0x14(%ebp)
	physaddr_t structend = PADDR(boot_freemem);
f01016a9:	a1 14 38 11 f0       	mov    0xf0113814,%eax
f01016ae:	89 45 f8             	mov    %eax,-0x8(%ebp)
f01016b1:	81 7d f8 ff ff ff ef 	cmpl   $0xefffffff,-0x8(%ebp)
f01016b8:	77 23                	ja     f01016dd <page_init+0x91>
f01016ba:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01016bd:	89 44 24 0c          	mov    %eax,0xc(%esp)
f01016c1:	c7 44 24 08 6c 3b 10 	movl   $0xf0103b6c,0x8(%esp)
f01016c8:	f0 
f01016c9:	c7 44 24 04 b3 01 00 	movl   $0x1b3,0x4(%esp)
f01016d0:	00 
f01016d1:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01016d8:	e8 38 ea ff ff       	call   f0100115 <_panic>
f01016dd:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01016e0:	05 00 00 00 10       	add    $0x10000000,%eax
f01016e5:	89 45 f0             	mov    %eax,-0x10(%ebp)
	
	for (i = 0; i < npage; i++) {
f01016e8:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
f01016ef:	e9 25 01 00 00       	jmp    f0101819 <page_init+0x1cd>
		if (i == 0) {
f01016f4:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
f01016f8:	75 20                	jne    f010171a <page_init+0xce>
			// First page is in use
			pages[i].pp_ref = 1;
f01016fa:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f0101700:	8b 55 e0             	mov    -0x20(%ebp),%edx
f0101703:	89 d0                	mov    %edx,%eax
f0101705:	01 c0                	add    %eax,%eax
f0101707:	01 d0                	add    %edx,%eax
f0101709:	c1 e0 02             	shl    $0x2,%eax
f010170c:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f010170f:	66 c7 40 08 01 00    	movw   $0x1,0x8(%eax)
f0101715:	e9 fb 00 00 00       	jmp    f0101815 <page_init+0x1c9>
		}
		else if (i >= nbasepages && i < ntotalbasepages) {
f010171a:	8b 45 e0             	mov    -0x20(%ebp),%eax
f010171d:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
f0101720:	72 28                	jb     f010174a <page_init+0xfe>
f0101722:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0101725:	3b 45 e8             	cmp    -0x18(%ebp),%eax
f0101728:	73 20                	jae    f010174a <page_init+0xfe>
			// IO pages are in use
			pages[i].pp_ref = 1;
f010172a:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f0101730:	8b 55 e0             	mov    -0x20(%ebp),%edx
f0101733:	89 d0                	mov    %edx,%eax
f0101735:	01 c0                	add    %eax,%eax
f0101737:	01 d0                	add    %edx,%eax
f0101739:	c1 e0 02             	shl    $0x2,%eax
f010173c:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f010173f:	66 c7 40 08 01 00    	movw   $0x1,0x8(%eax)
f0101745:	e9 cb 00 00 00       	jmp    f0101815 <page_init+0x1c9>
		}
		else if (i >= (kernbase / 1024) && i < (structend / PGSIZE)) {
f010174a:	8b 45 e0             	mov    -0x20(%ebp),%eax
f010174d:	8b 55 ec             	mov    -0x14(%ebp),%edx
f0101750:	c1 ea 0a             	shr    $0xa,%edx
f0101753:	39 d0                	cmp    %edx,%eax
f0101755:	72 2d                	jb     f0101784 <page_init+0x138>
f0101757:	8b 45 e0             	mov    -0x20(%ebp),%eax
f010175a:	8b 55 f0             	mov    -0x10(%ebp),%edx
f010175d:	c1 ea 0c             	shr    $0xc,%edx
f0101760:	39 d0                	cmp    %edx,%eax
f0101762:	73 20                	jae    f0101784 <page_init+0x138>
			// Kernel code and data structures are in use
			pages[i].pp_ref = 1;
f0101764:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f010176a:	8b 55 e0             	mov    -0x20(%ebp),%edx
f010176d:	89 d0                	mov    %edx,%eax
f010176f:	01 c0                	add    %eax,%eax
f0101771:	01 d0                	add    %edx,%eax
f0101773:	c1 e0 02             	shl    $0x2,%eax
f0101776:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f0101779:	66 c7 40 08 01 00    	movw   $0x1,0x8(%eax)
f010177f:	e9 91 00 00 00       	jmp    f0101815 <page_init+0x1c9>
		}
		else {
			// The rest of the pages are free
			pages[i].pp_ref = 0;
f0101784:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f010178a:	8b 55 e0             	mov    -0x20(%ebp),%edx
f010178d:	89 d0                	mov    %edx,%eax
f010178f:	01 c0                	add    %eax,%eax
f0101791:	01 d0                	add    %edx,%eax
f0101793:	c1 e0 02             	shl    $0x2,%eax
f0101796:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f0101799:	66 c7 40 08 00 00    	movw   $0x0,0x8(%eax)
			LIST_INSERT_HEAD(&page_free_list, &pages[i], pp_link);
f010179f:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f01017a5:	8b 55 e0             	mov    -0x20(%ebp),%edx
f01017a8:	89 d0                	mov    %edx,%eax
f01017aa:	01 c0                	add    %eax,%eax
f01017ac:	01 d0                	add    %edx,%eax
f01017ae:	c1 e0 02             	shl    $0x2,%eax
f01017b1:	8d 14 01             	lea    (%ecx,%eax,1),%edx
f01017b4:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f01017b9:	89 02                	mov    %eax,(%edx)
f01017bb:	8b 02                	mov    (%edx),%eax
f01017bd:	85 c0                	test   %eax,%eax
f01017bf:	74 1e                	je     f01017df <page_init+0x193>
f01017c1:	8b 0d 18 38 11 f0    	mov    0xf0113818,%ecx
f01017c7:	8b 1d 2c 3c 11 f0    	mov    0xf0113c2c,%ebx
f01017cd:	8b 55 e0             	mov    -0x20(%ebp),%edx
f01017d0:	89 d0                	mov    %edx,%eax
f01017d2:	01 c0                	add    %eax,%eax
f01017d4:	01 d0                	add    %edx,%eax
f01017d6:	c1 e0 02             	shl    $0x2,%eax
f01017d9:	8d 04 03             	lea    (%ebx,%eax,1),%eax
f01017dc:	89 41 04             	mov    %eax,0x4(%ecx)
f01017df:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f01017e5:	8b 55 e0             	mov    -0x20(%ebp),%edx
f01017e8:	89 d0                	mov    %edx,%eax
f01017ea:	01 c0                	add    %eax,%eax
f01017ec:	01 d0                	add    %edx,%eax
f01017ee:	c1 e0 02             	shl    $0x2,%eax
f01017f1:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f01017f4:	a3 18 38 11 f0       	mov    %eax,0xf0113818
f01017f9:	8b 0d 2c 3c 11 f0    	mov    0xf0113c2c,%ecx
f01017ff:	8b 55 e0             	mov    -0x20(%ebp),%edx
f0101802:	89 d0                	mov    %edx,%eax
f0101804:	01 c0                	add    %eax,%eax
f0101806:	01 d0                	add    %edx,%eax
f0101808:	c1 e0 02             	shl    $0x2,%eax
f010180b:	8d 04 01             	lea    (%ecx,%eax,1),%eax
f010180e:	c7 40 04 18 38 11 f0 	movl   $0xf0113818,0x4(%eax)
	size_t ntotalbasepages = EXTPHYSMEM / PGSIZE;

	physaddr_t kernbase =  PADDR(0xF0100000);
	physaddr_t structend = PADDR(boot_freemem);
	
	for (i = 0; i < npage; i++) {
f0101815:	83 45 e0 01          	addl   $0x1,-0x20(%ebp)
f0101819:	8b 55 e0             	mov    -0x20(%ebp),%edx
f010181c:	a1 20 3c 11 f0       	mov    0xf0113c20,%eax
f0101821:	39 c2                	cmp    %eax,%edx
f0101823:	0f 82 cb fe ff ff    	jb     f01016f4 <page_init+0xa8>
			// The rest of the pages are free
			pages[i].pp_ref = 0;
			LIST_INSERT_HEAD(&page_free_list, &pages[i], pp_link);
		}
	}
}
f0101829:	83 c4 34             	add    $0x34,%esp
f010182c:	5b                   	pop    %ebx
f010182d:	5d                   	pop    %ebp
f010182e:	c3                   	ret    

f010182f <page_initpp>:
// The result has null links and 0 refcount.
// Note that the corresponding physical page is NOT initialized!
//
static void
page_initpp(struct Page *pp)
{
f010182f:	55                   	push   %ebp
f0101830:	89 e5                	mov    %esp,%ebp
f0101832:	83 ec 18             	sub    $0x18,%esp
	memset(pp, 0, sizeof(*pp));
f0101835:	c7 44 24 08 0c 00 00 	movl   $0xc,0x8(%esp)
f010183c:	00 
f010183d:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0101844:	00 
f0101845:	8b 45 08             	mov    0x8(%ebp),%eax
f0101848:	89 04 24             	mov    %eax,(%esp)
f010184b:	e8 40 1a 00 00       	call   f0103290 <memset>
}
f0101850:	c9                   	leave  
f0101851:	c3                   	ret    

f0101852 <page_alloc>:
//
// Hint: use LIST_FIRST, LIST_REMOVE, and page_initpp
// Hint: pp_ref should not be incremented 
int
page_alloc(struct Page **pp_store)
{
f0101852:	55                   	push   %ebp
f0101853:	89 e5                	mov    %esp,%ebp
f0101855:	83 ec 08             	sub    $0x8,%esp
	if(LIST_EMPTY(&page_free_list))
f0101858:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f010185d:	85 c0                	test   %eax,%eax
f010185f:	75 09                	jne    f010186a <page_alloc+0x18>
	{
		return -E_NO_MEM;
f0101861:	c7 45 fc fc ff ff ff 	movl   $0xfffffffc,-0x4(%ebp)
f0101868:	eb 4d                	jmp    f01018b7 <page_alloc+0x65>
	}
	else
	{
		*pp_store = LIST_FIRST(&page_free_list);
f010186a:	8b 15 18 38 11 f0    	mov    0xf0113818,%edx
f0101870:	8b 45 08             	mov    0x8(%ebp),%eax
f0101873:	89 10                	mov    %edx,(%eax)
		LIST_REMOVE(*pp_store, pp_link);
f0101875:	8b 45 08             	mov    0x8(%ebp),%eax
f0101878:	8b 00                	mov    (%eax),%eax
f010187a:	8b 00                	mov    (%eax),%eax
f010187c:	85 c0                	test   %eax,%eax
f010187e:	74 12                	je     f0101892 <page_alloc+0x40>
f0101880:	8b 45 08             	mov    0x8(%ebp),%eax
f0101883:	8b 00                	mov    (%eax),%eax
f0101885:	8b 10                	mov    (%eax),%edx
f0101887:	8b 45 08             	mov    0x8(%ebp),%eax
f010188a:	8b 00                	mov    (%eax),%eax
f010188c:	8b 40 04             	mov    0x4(%eax),%eax
f010188f:	89 42 04             	mov    %eax,0x4(%edx)
f0101892:	8b 45 08             	mov    0x8(%ebp),%eax
f0101895:	8b 00                	mov    (%eax),%eax
f0101897:	8b 50 04             	mov    0x4(%eax),%edx
f010189a:	8b 45 08             	mov    0x8(%ebp),%eax
f010189d:	8b 00                	mov    (%eax),%eax
f010189f:	8b 00                	mov    (%eax),%eax
f01018a1:	89 02                	mov    %eax,(%edx)
		page_initpp(*pp_store);
f01018a3:	8b 45 08             	mov    0x8(%ebp),%eax
f01018a6:	8b 00                	mov    (%eax),%eax
f01018a8:	89 04 24             	mov    %eax,(%esp)
f01018ab:	e8 7f ff ff ff       	call   f010182f <page_initpp>
		return 0;
f01018b0:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f01018b7:	8b 45 fc             	mov    -0x4(%ebp),%eax
	}
}
f01018ba:	c9                   	leave  
f01018bb:	c3                   	ret    

f01018bc <page_free>:
// Return a page to the free list.
// (This function should only be called when pp->pp_ref reaches 0.)
//
void
page_free(struct Page *pp)
{
f01018bc:	55                   	push   %ebp
f01018bd:	89 e5                	mov    %esp,%ebp
	if(pp->pp_ref == 0)
f01018bf:	8b 45 08             	mov    0x8(%ebp),%eax
f01018c2:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f01018c6:	66 85 c0             	test   %ax,%ax
f01018c9:	75 3a                	jne    f0101905 <page_free+0x49>
	{
		LIST_INSERT_AFTER(LIST_FIRST(&page_free_list), pp, pp_link);
f01018cb:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f01018d0:	8b 10                	mov    (%eax),%edx
f01018d2:	8b 45 08             	mov    0x8(%ebp),%eax
f01018d5:	89 10                	mov    %edx,(%eax)
f01018d7:	8b 45 08             	mov    0x8(%ebp),%eax
f01018da:	8b 00                	mov    (%eax),%eax
f01018dc:	85 c0                	test   %eax,%eax
f01018de:	74 0d                	je     f01018ed <page_free+0x31>
f01018e0:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f01018e5:	8b 10                	mov    (%eax),%edx
f01018e7:	8b 45 08             	mov    0x8(%ebp),%eax
f01018ea:	89 42 04             	mov    %eax,0x4(%edx)
f01018ed:	8b 15 18 38 11 f0    	mov    0xf0113818,%edx
f01018f3:	8b 45 08             	mov    0x8(%ebp),%eax
f01018f6:	89 02                	mov    %eax,(%edx)
f01018f8:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f01018fd:	89 c2                	mov    %eax,%edx
f01018ff:	8b 45 08             	mov    0x8(%ebp),%eax
f0101902:	89 50 04             	mov    %edx,0x4(%eax)
	}
}
f0101905:	5d                   	pop    %ebp
f0101906:	c3                   	ret    

f0101907 <page_decref>:
//
// Decrement the reference count on a page, freeing it if there are no more refs.
//
void
page_decref(struct Page* pp)
{
f0101907:	55                   	push   %ebp
f0101908:	89 e5                	mov    %esp,%ebp
f010190a:	83 ec 04             	sub    $0x4,%esp
	if (--pp->pp_ref == 0)
f010190d:	8b 45 08             	mov    0x8(%ebp),%eax
f0101910:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101914:	8d 50 ff             	lea    -0x1(%eax),%edx
f0101917:	8b 45 08             	mov    0x8(%ebp),%eax
f010191a:	66 89 50 08          	mov    %dx,0x8(%eax)
f010191e:	8b 45 08             	mov    0x8(%ebp),%eax
f0101921:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101925:	66 85 c0             	test   %ax,%ax
f0101928:	75 0b                	jne    f0101935 <page_decref+0x2e>
		page_free(pp);
f010192a:	8b 45 08             	mov    0x8(%ebp),%eax
f010192d:	89 04 24             	mov    %eax,(%esp)
f0101930:	e8 87 ff ff ff       	call   f01018bc <page_free>
}
f0101935:	c9                   	leave  
f0101936:	c3                   	ret    

f0101937 <pgdir_walk>:
//
// Hint: you can turn a Page * into the physical address of the
// page it refers to with page2pa() from kern/pmap.h
int
pgdir_walk(pde_t *pgdir, const void *va, int create, pte_t **pte_store)
{
f0101937:	55                   	push   %ebp
f0101938:	89 e5                	mov    %esp,%ebp
f010193a:	83 ec 04             	sub    $0x4,%esp
	// Fill this function in

}
f010193d:	c9                   	leave  
f010193e:	c3                   	ret    

f010193f <page_insert>:
// Hint: The TA solution is implemented using
//   pgdir_walk() and and page_remove().
//
int
page_insert(pde_t *pgdir, struct Page *pp, void *va, int perm) 
{
f010193f:	55                   	push   %ebp
f0101940:	89 e5                	mov    %esp,%ebp
f0101942:	83 ec 04             	sub    $0x4,%esp
	// Fill this function in

}
f0101945:	c9                   	leave  
f0101946:	c3                   	ret    

f0101947 <page_lookup>:
//
// Hint: the TA solution uses pgdir_walk and pa2page.
//
struct Page *
page_lookup(pde_t *pgdir, void *va, pte_t **pte_store)
{
f0101947:	55                   	push   %ebp
f0101948:	89 e5                	mov    %esp,%ebp
f010194a:	83 ec 04             	sub    $0x4,%esp
	// Fill this function in

}
f010194d:	c9                   	leave  
f010194e:	c3                   	ret    

f010194f <page_remove>:
// Hint: The TA solution is implemented using page_lookup,
// 	tlb_invalidate, and page_decref.
//
void
page_remove(pde_t *pgdir, void *va)
{
f010194f:	55                   	push   %ebp
f0101950:	89 e5                	mov    %esp,%ebp
	// Fill this function in

}
f0101952:	5d                   	pop    %ebp
f0101953:	c3                   	ret    

f0101954 <tlb_invalidate>:
// Invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
//
void
tlb_invalidate(pde_t *pgdir, void *va)
{
f0101954:	55                   	push   %ebp
f0101955:	89 e5                	mov    %esp,%ebp
f0101957:	83 ec 10             	sub    $0x10,%esp
f010195a:	8b 45 0c             	mov    0xc(%ebp),%eax
f010195d:	89 45 fc             	mov    %eax,-0x4(%ebp)
}

static __inline void 
invlpg(void *addr)
{ 
	__asm __volatile("invlpg (%0)" : : "r" (addr) : "memory");
f0101960:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0101963:	0f 01 38             	invlpg (%eax)
	// Flush the entry only if we're modifying the current address space.
	// For now, there is only one address space, so always invalidate.
	invlpg(va);
}
f0101966:	c9                   	leave  
f0101967:	c3                   	ret    

f0101968 <page_check>:

void
page_check(void)
{
f0101968:	55                   	push   %ebp
f0101969:	89 e5                	mov    %esp,%ebp
f010196b:	53                   	push   %ebx
f010196c:	83 ec 34             	sub    $0x34,%esp
	struct Page *pp, *pp0, *pp1, *pp2;
	struct Page_list fl;

	// should be able to allocate three pages
	pp0 = pp1 = pp2 = 0;
f010196f:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
f0101976:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101979:	89 45 f0             	mov    %eax,-0x10(%ebp)
f010197c:	8b 45 f0             	mov    -0x10(%ebp),%eax
f010197f:	89 45 f4             	mov    %eax,-0xc(%ebp)
	assert(page_alloc(&pp0) == 0);
f0101982:	8d 45 f4             	lea    -0xc(%ebp),%eax
f0101985:	89 04 24             	mov    %eax,(%esp)
f0101988:	e8 c5 fe ff ff       	call   f0101852 <page_alloc>
f010198d:	85 c0                	test   %eax,%eax
f010198f:	74 24                	je     f01019b5 <page_check+0x4d>
f0101991:	c7 44 24 0c 7b 3c 10 	movl   $0xf0103c7b,0xc(%esp)
f0101998:	f0 
f0101999:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01019a0:	f0 
f01019a1:	c7 44 24 04 72 02 00 	movl   $0x272,0x4(%esp)
f01019a8:	00 
f01019a9:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01019b0:	e8 60 e7 ff ff       	call   f0100115 <_panic>
	assert(page_alloc(&pp1) == 0);
f01019b5:	8d 45 f0             	lea    -0x10(%ebp),%eax
f01019b8:	89 04 24             	mov    %eax,(%esp)
f01019bb:	e8 92 fe ff ff       	call   f0101852 <page_alloc>
f01019c0:	85 c0                	test   %eax,%eax
f01019c2:	74 24                	je     f01019e8 <page_check+0x80>
f01019c4:	c7 44 24 0c 91 3c 10 	movl   $0xf0103c91,0xc(%esp)
f01019cb:	f0 
f01019cc:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01019d3:	f0 
f01019d4:	c7 44 24 04 73 02 00 	movl   $0x273,0x4(%esp)
f01019db:	00 
f01019dc:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01019e3:	e8 2d e7 ff ff       	call   f0100115 <_panic>
	assert(page_alloc(&pp2) == 0);
f01019e8:	8d 45 ec             	lea    -0x14(%ebp),%eax
f01019eb:	89 04 24             	mov    %eax,(%esp)
f01019ee:	e8 5f fe ff ff       	call   f0101852 <page_alloc>
f01019f3:	85 c0                	test   %eax,%eax
f01019f5:	74 24                	je     f0101a1b <page_check+0xb3>
f01019f7:	c7 44 24 0c a7 3c 10 	movl   $0xf0103ca7,0xc(%esp)
f01019fe:	f0 
f01019ff:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101a06:	f0 
f0101a07:	c7 44 24 04 74 02 00 	movl   $0x274,0x4(%esp)
f0101a0e:	00 
f0101a0f:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101a16:	e8 fa e6 ff ff       	call   f0100115 <_panic>

	assert(pp0);
f0101a1b:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101a1e:	85 c0                	test   %eax,%eax
f0101a20:	75 24                	jne    f0101a46 <page_check+0xde>
f0101a22:	c7 44 24 0c bd 3c 10 	movl   $0xf0103cbd,0xc(%esp)
f0101a29:	f0 
f0101a2a:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101a31:	f0 
f0101a32:	c7 44 24 04 76 02 00 	movl   $0x276,0x4(%esp)
f0101a39:	00 
f0101a3a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101a41:	e8 cf e6 ff ff       	call   f0100115 <_panic>
	assert(pp1 && pp1 != pp0);
f0101a46:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101a49:	85 c0                	test   %eax,%eax
f0101a4b:	74 0a                	je     f0101a57 <page_check+0xef>
f0101a4d:	8b 55 f0             	mov    -0x10(%ebp),%edx
f0101a50:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101a53:	39 c2                	cmp    %eax,%edx
f0101a55:	75 24                	jne    f0101a7b <page_check+0x113>
f0101a57:	c7 44 24 0c c1 3c 10 	movl   $0xf0103cc1,0xc(%esp)
f0101a5e:	f0 
f0101a5f:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101a66:	f0 
f0101a67:	c7 44 24 04 77 02 00 	movl   $0x277,0x4(%esp)
f0101a6e:	00 
f0101a6f:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101a76:	e8 9a e6 ff ff       	call   f0100115 <_panic>
	assert(pp2 && pp2 != pp1 && pp2 != pp0);
f0101a7b:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101a7e:	85 c0                	test   %eax,%eax
f0101a80:	74 14                	je     f0101a96 <page_check+0x12e>
f0101a82:	8b 55 ec             	mov    -0x14(%ebp),%edx
f0101a85:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101a88:	39 c2                	cmp    %eax,%edx
f0101a8a:	74 0a                	je     f0101a96 <page_check+0x12e>
f0101a8c:	8b 55 ec             	mov    -0x14(%ebp),%edx
f0101a8f:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101a92:	39 c2                	cmp    %eax,%edx
f0101a94:	75 24                	jne    f0101aba <page_check+0x152>
f0101a96:	c7 44 24 0c d4 3c 10 	movl   $0xf0103cd4,0xc(%esp)
f0101a9d:	f0 
f0101a9e:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101aa5:	f0 
f0101aa6:	c7 44 24 04 78 02 00 	movl   $0x278,0x4(%esp)
f0101aad:	00 
f0101aae:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101ab5:	e8 5b e6 ff ff       	call   f0100115 <_panic>

	// temporarily steal the rest of the free pages
	fl = page_free_list;
f0101aba:	a1 18 38 11 f0       	mov    0xf0113818,%eax
f0101abf:	89 45 e8             	mov    %eax,-0x18(%ebp)
	LIST_INIT(&page_free_list);
f0101ac2:	c7 05 18 38 11 f0 00 	movl   $0x0,0xf0113818
f0101ac9:	00 00 00 

	// should be no free memory
	assert(page_alloc(&pp) == -E_NO_MEM);
f0101acc:	8d 45 f8             	lea    -0x8(%ebp),%eax
f0101acf:	89 04 24             	mov    %eax,(%esp)
f0101ad2:	e8 7b fd ff ff       	call   f0101852 <page_alloc>
f0101ad7:	83 f8 fc             	cmp    $0xfffffffc,%eax
f0101ada:	74 24                	je     f0101b00 <page_check+0x198>
f0101adc:	c7 44 24 0c f4 3c 10 	movl   $0xf0103cf4,0xc(%esp)
f0101ae3:	f0 
f0101ae4:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101aeb:	f0 
f0101aec:	c7 44 24 04 7f 02 00 	movl   $0x27f,0x4(%esp)
f0101af3:	00 
f0101af4:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101afb:	e8 15 e6 ff ff       	call   f0100115 <_panic>

	// there is no free memory, so we can't allocate a page table 
	assert(page_insert(boot_pgdir, pp1, 0x0, 0) < 0);
f0101b00:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101b03:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101b09:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101b10:	00 
f0101b11:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
f0101b18:	00 
f0101b19:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101b1d:	89 14 24             	mov    %edx,(%esp)
f0101b20:	e8 1a fe ff ff       	call   f010193f <page_insert>
f0101b25:	85 c0                	test   %eax,%eax
f0101b27:	78 24                	js     f0101b4d <page_check+0x1e5>
f0101b29:	c7 44 24 0c 14 3d 10 	movl   $0xf0103d14,0xc(%esp)
f0101b30:	f0 
f0101b31:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101b38:	f0 
f0101b39:	c7 44 24 04 82 02 00 	movl   $0x282,0x4(%esp)
f0101b40:	00 
f0101b41:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101b48:	e8 c8 e5 ff ff       	call   f0100115 <_panic>

	// free pp0 and try again: pp0 should be used for page table
	page_free(pp0);
f0101b4d:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101b50:	89 04 24             	mov    %eax,(%esp)
f0101b53:	e8 64 fd ff ff       	call   f01018bc <page_free>
	assert(page_insert(boot_pgdir, pp1, 0x0, 0) == 0);
f0101b58:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101b5b:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101b61:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101b68:	00 
f0101b69:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
f0101b70:	00 
f0101b71:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101b75:	89 14 24             	mov    %edx,(%esp)
f0101b78:	e8 c2 fd ff ff       	call   f010193f <page_insert>
f0101b7d:	85 c0                	test   %eax,%eax
f0101b7f:	74 24                	je     f0101ba5 <page_check+0x23d>
f0101b81:	c7 44 24 0c 40 3d 10 	movl   $0xf0103d40,0xc(%esp)
f0101b88:	f0 
f0101b89:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101b90:	f0 
f0101b91:	c7 44 24 04 86 02 00 	movl   $0x286,0x4(%esp)
f0101b98:	00 
f0101b99:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101ba0:	e8 70 e5 ff ff       	call   f0100115 <_panic>
	assert(PTE_ADDR(boot_pgdir[0]) == page2pa(pp0));
f0101ba5:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101baa:	8b 00                	mov    (%eax),%eax
f0101bac:	89 c3                	mov    %eax,%ebx
f0101bae:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
f0101bb4:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101bb7:	89 04 24             	mov    %eax,(%esp)
f0101bba:	e8 ba 07 00 00       	call   f0102379 <page2pa>
f0101bbf:	39 c3                	cmp    %eax,%ebx
f0101bc1:	74 24                	je     f0101be7 <page_check+0x27f>
f0101bc3:	c7 44 24 0c 6c 3d 10 	movl   $0xf0103d6c,0xc(%esp)
f0101bca:	f0 
f0101bcb:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101bd2:	f0 
f0101bd3:	c7 44 24 04 87 02 00 	movl   $0x287,0x4(%esp)
f0101bda:	00 
f0101bdb:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101be2:	e8 2e e5 ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, 0x0) == page2pa(pp1));
f0101be7:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101bec:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0101bf3:	00 
f0101bf4:	89 04 24             	mov    %eax,(%esp)
f0101bf7:	e8 92 f9 ff ff       	call   f010158e <check_va2pa>
f0101bfc:	89 c3                	mov    %eax,%ebx
f0101bfe:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101c01:	89 04 24             	mov    %eax,(%esp)
f0101c04:	e8 70 07 00 00       	call   f0102379 <page2pa>
f0101c09:	39 c3                	cmp    %eax,%ebx
f0101c0b:	74 24                	je     f0101c31 <page_check+0x2c9>
f0101c0d:	c7 44 24 0c 94 3d 10 	movl   $0xf0103d94,0xc(%esp)
f0101c14:	f0 
f0101c15:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101c1c:	f0 
f0101c1d:	c7 44 24 04 88 02 00 	movl   $0x288,0x4(%esp)
f0101c24:	00 
f0101c25:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101c2c:	e8 e4 e4 ff ff       	call   f0100115 <_panic>
	assert(pp1->pp_ref == 1);
f0101c31:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101c34:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101c38:	66 83 f8 01          	cmp    $0x1,%ax
f0101c3c:	74 24                	je     f0101c62 <page_check+0x2fa>
f0101c3e:	c7 44 24 0c c1 3d 10 	movl   $0xf0103dc1,0xc(%esp)
f0101c45:	f0 
f0101c46:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101c4d:	f0 
f0101c4e:	c7 44 24 04 89 02 00 	movl   $0x289,0x4(%esp)
f0101c55:	00 
f0101c56:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101c5d:	e8 b3 e4 ff ff       	call   f0100115 <_panic>
	assert(pp0->pp_ref == 1);
f0101c62:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101c65:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101c69:	66 83 f8 01          	cmp    $0x1,%ax
f0101c6d:	74 24                	je     f0101c93 <page_check+0x32b>
f0101c6f:	c7 44 24 0c d2 3d 10 	movl   $0xf0103dd2,0xc(%esp)
f0101c76:	f0 
f0101c77:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101c7e:	f0 
f0101c7f:	c7 44 24 04 8a 02 00 	movl   $0x28a,0x4(%esp)
f0101c86:	00 
f0101c87:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101c8e:	e8 82 e4 ff ff       	call   f0100115 <_panic>

	// should be able to map pp2 at PGSIZE because pp0 is already allocated for page table
	assert(page_insert(boot_pgdir, pp2, (void*) PGSIZE, 0) == 0);
f0101c93:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101c96:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101c9c:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101ca3:	00 
f0101ca4:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
f0101cab:	00 
f0101cac:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101cb0:	89 14 24             	mov    %edx,(%esp)
f0101cb3:	e8 87 fc ff ff       	call   f010193f <page_insert>
f0101cb8:	85 c0                	test   %eax,%eax
f0101cba:	74 24                	je     f0101ce0 <page_check+0x378>
f0101cbc:	c7 44 24 0c e4 3d 10 	movl   $0xf0103de4,0xc(%esp)
f0101cc3:	f0 
f0101cc4:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101ccb:	f0 
f0101ccc:	c7 44 24 04 8d 02 00 	movl   $0x28d,0x4(%esp)
f0101cd3:	00 
f0101cd4:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101cdb:	e8 35 e4 ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, PGSIZE) == page2pa(pp2));
f0101ce0:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101ce5:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0101cec:	00 
f0101ced:	89 04 24             	mov    %eax,(%esp)
f0101cf0:	e8 99 f8 ff ff       	call   f010158e <check_va2pa>
f0101cf5:	89 c3                	mov    %eax,%ebx
f0101cf7:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101cfa:	89 04 24             	mov    %eax,(%esp)
f0101cfd:	e8 77 06 00 00       	call   f0102379 <page2pa>
f0101d02:	39 c3                	cmp    %eax,%ebx
f0101d04:	74 24                	je     f0101d2a <page_check+0x3c2>
f0101d06:	c7 44 24 0c 1c 3e 10 	movl   $0xf0103e1c,0xc(%esp)
f0101d0d:	f0 
f0101d0e:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101d15:	f0 
f0101d16:	c7 44 24 04 8e 02 00 	movl   $0x28e,0x4(%esp)
f0101d1d:	00 
f0101d1e:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101d25:	e8 eb e3 ff ff       	call   f0100115 <_panic>
	assert(pp2->pp_ref == 1);
f0101d2a:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101d2d:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101d31:	66 83 f8 01          	cmp    $0x1,%ax
f0101d35:	74 24                	je     f0101d5b <page_check+0x3f3>
f0101d37:	c7 44 24 0c 4c 3e 10 	movl   $0xf0103e4c,0xc(%esp)
f0101d3e:	f0 
f0101d3f:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101d46:	f0 
f0101d47:	c7 44 24 04 8f 02 00 	movl   $0x28f,0x4(%esp)
f0101d4e:	00 
f0101d4f:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101d56:	e8 ba e3 ff ff       	call   f0100115 <_panic>

	// should be no free memory
	assert(page_alloc(&pp) == -E_NO_MEM);
f0101d5b:	8d 45 f8             	lea    -0x8(%ebp),%eax
f0101d5e:	89 04 24             	mov    %eax,(%esp)
f0101d61:	e8 ec fa ff ff       	call   f0101852 <page_alloc>
f0101d66:	83 f8 fc             	cmp    $0xfffffffc,%eax
f0101d69:	74 24                	je     f0101d8f <page_check+0x427>
f0101d6b:	c7 44 24 0c f4 3c 10 	movl   $0xf0103cf4,0xc(%esp)
f0101d72:	f0 
f0101d73:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101d7a:	f0 
f0101d7b:	c7 44 24 04 92 02 00 	movl   $0x292,0x4(%esp)
f0101d82:	00 
f0101d83:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101d8a:	e8 86 e3 ff ff       	call   f0100115 <_panic>

	// should be able to map pp2 at PGSIZE because it's already there
	assert(page_insert(boot_pgdir, pp2, (void*) PGSIZE, 0) == 0);
f0101d8f:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101d92:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101d98:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101d9f:	00 
f0101da0:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
f0101da7:	00 
f0101da8:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101dac:	89 14 24             	mov    %edx,(%esp)
f0101daf:	e8 8b fb ff ff       	call   f010193f <page_insert>
f0101db4:	85 c0                	test   %eax,%eax
f0101db6:	74 24                	je     f0101ddc <page_check+0x474>
f0101db8:	c7 44 24 0c e4 3d 10 	movl   $0xf0103de4,0xc(%esp)
f0101dbf:	f0 
f0101dc0:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101dc7:	f0 
f0101dc8:	c7 44 24 04 95 02 00 	movl   $0x295,0x4(%esp)
f0101dcf:	00 
f0101dd0:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101dd7:	e8 39 e3 ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, PGSIZE) == page2pa(pp2));
f0101ddc:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101de1:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0101de8:	00 
f0101de9:	89 04 24             	mov    %eax,(%esp)
f0101dec:	e8 9d f7 ff ff       	call   f010158e <check_va2pa>
f0101df1:	89 c3                	mov    %eax,%ebx
f0101df3:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101df6:	89 04 24             	mov    %eax,(%esp)
f0101df9:	e8 7b 05 00 00       	call   f0102379 <page2pa>
f0101dfe:	39 c3                	cmp    %eax,%ebx
f0101e00:	74 24                	je     f0101e26 <page_check+0x4be>
f0101e02:	c7 44 24 0c 1c 3e 10 	movl   $0xf0103e1c,0xc(%esp)
f0101e09:	f0 
f0101e0a:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101e11:	f0 
f0101e12:	c7 44 24 04 96 02 00 	movl   $0x296,0x4(%esp)
f0101e19:	00 
f0101e1a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101e21:	e8 ef e2 ff ff       	call   f0100115 <_panic>
	assert(pp2->pp_ref == 1);
f0101e26:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101e29:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101e2d:	66 83 f8 01          	cmp    $0x1,%ax
f0101e31:	74 24                	je     f0101e57 <page_check+0x4ef>
f0101e33:	c7 44 24 0c 4c 3e 10 	movl   $0xf0103e4c,0xc(%esp)
f0101e3a:	f0 
f0101e3b:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101e42:	f0 
f0101e43:	c7 44 24 04 97 02 00 	movl   $0x297,0x4(%esp)
f0101e4a:	00 
f0101e4b:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101e52:	e8 be e2 ff ff       	call   f0100115 <_panic>

	// pp2 should NOT be on the free list
	// could happen in ref counts are handled sloppily in page_insert
	assert(page_alloc(&pp) == -E_NO_MEM);
f0101e57:	8d 45 f8             	lea    -0x8(%ebp),%eax
f0101e5a:	89 04 24             	mov    %eax,(%esp)
f0101e5d:	e8 f0 f9 ff ff       	call   f0101852 <page_alloc>
f0101e62:	83 f8 fc             	cmp    $0xfffffffc,%eax
f0101e65:	74 24                	je     f0101e8b <page_check+0x523>
f0101e67:	c7 44 24 0c f4 3c 10 	movl   $0xf0103cf4,0xc(%esp)
f0101e6e:	f0 
f0101e6f:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101e76:	f0 
f0101e77:	c7 44 24 04 9b 02 00 	movl   $0x29b,0x4(%esp)
f0101e7e:	00 
f0101e7f:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101e86:	e8 8a e2 ff ff       	call   f0100115 <_panic>

	// should not be able to map at PTSIZE because need free page for page table
	assert(page_insert(boot_pgdir, pp0, (void*) PTSIZE, 0) < 0);
f0101e8b:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0101e8e:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101e94:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101e9b:	00 
f0101e9c:	c7 44 24 08 00 00 40 	movl   $0x400000,0x8(%esp)
f0101ea3:	00 
f0101ea4:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101ea8:	89 14 24             	mov    %edx,(%esp)
f0101eab:	e8 8f fa ff ff       	call   f010193f <page_insert>
f0101eb0:	85 c0                	test   %eax,%eax
f0101eb2:	78 24                	js     f0101ed8 <page_check+0x570>
f0101eb4:	c7 44 24 0c 60 3e 10 	movl   $0xf0103e60,0xc(%esp)
f0101ebb:	f0 
f0101ebc:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101ec3:	f0 
f0101ec4:	c7 44 24 04 9e 02 00 	movl   $0x29e,0x4(%esp)
f0101ecb:	00 
f0101ecc:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101ed3:	e8 3d e2 ff ff       	call   f0100115 <_panic>

	// insert pp1 at PGSIZE (replacing pp2)
	assert(page_insert(boot_pgdir, pp1, (void*) PGSIZE, 0) == 0);
f0101ed8:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101edb:	8b 15 28 3c 11 f0    	mov    0xf0113c28,%edx
f0101ee1:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
f0101ee8:	00 
f0101ee9:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
f0101ef0:	00 
f0101ef1:	89 44 24 04          	mov    %eax,0x4(%esp)
f0101ef5:	89 14 24             	mov    %edx,(%esp)
f0101ef8:	e8 42 fa ff ff       	call   f010193f <page_insert>
f0101efd:	85 c0                	test   %eax,%eax
f0101eff:	74 24                	je     f0101f25 <page_check+0x5bd>
f0101f01:	c7 44 24 0c 94 3e 10 	movl   $0xf0103e94,0xc(%esp)
f0101f08:	f0 
f0101f09:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101f10:	f0 
f0101f11:	c7 44 24 04 a1 02 00 	movl   $0x2a1,0x4(%esp)
f0101f18:	00 
f0101f19:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101f20:	e8 f0 e1 ff ff       	call   f0100115 <_panic>

	// should have pp1 at both 0 and PGSIZE, pp2 nowhere, ...
	assert(check_va2pa(boot_pgdir, 0) == page2pa(pp1));
f0101f25:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101f2a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0101f31:	00 
f0101f32:	89 04 24             	mov    %eax,(%esp)
f0101f35:	e8 54 f6 ff ff       	call   f010158e <check_va2pa>
f0101f3a:	89 c3                	mov    %eax,%ebx
f0101f3c:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101f3f:	89 04 24             	mov    %eax,(%esp)
f0101f42:	e8 32 04 00 00       	call   f0102379 <page2pa>
f0101f47:	39 c3                	cmp    %eax,%ebx
f0101f49:	74 24                	je     f0101f6f <page_check+0x607>
f0101f4b:	c7 44 24 0c cc 3e 10 	movl   $0xf0103ecc,0xc(%esp)
f0101f52:	f0 
f0101f53:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101f5a:	f0 
f0101f5b:	c7 44 24 04 a4 02 00 	movl   $0x2a4,0x4(%esp)
f0101f62:	00 
f0101f63:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101f6a:	e8 a6 e1 ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, PGSIZE) == page2pa(pp1));
f0101f6f:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0101f74:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0101f7b:	00 
f0101f7c:	89 04 24             	mov    %eax,(%esp)
f0101f7f:	e8 0a f6 ff ff       	call   f010158e <check_va2pa>
f0101f84:	89 c3                	mov    %eax,%ebx
f0101f86:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101f89:	89 04 24             	mov    %eax,(%esp)
f0101f8c:	e8 e8 03 00 00       	call   f0102379 <page2pa>
f0101f91:	39 c3                	cmp    %eax,%ebx
f0101f93:	74 24                	je     f0101fb9 <page_check+0x651>
f0101f95:	c7 44 24 0c f8 3e 10 	movl   $0xf0103ef8,0xc(%esp)
f0101f9c:	f0 
f0101f9d:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101fa4:	f0 
f0101fa5:	c7 44 24 04 a5 02 00 	movl   $0x2a5,0x4(%esp)
f0101fac:	00 
f0101fad:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101fb4:	e8 5c e1 ff ff       	call   f0100115 <_panic>
	// ... and ref counts should reflect this
	assert(pp1->pp_ref == 2);
f0101fb9:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0101fbc:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101fc0:	66 83 f8 02          	cmp    $0x2,%ax
f0101fc4:	74 24                	je     f0101fea <page_check+0x682>
f0101fc6:	c7 44 24 0c 28 3f 10 	movl   $0xf0103f28,0xc(%esp)
f0101fcd:	f0 
f0101fce:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0101fd5:	f0 
f0101fd6:	c7 44 24 04 a7 02 00 	movl   $0x2a7,0x4(%esp)
f0101fdd:	00 
f0101fde:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0101fe5:	e8 2b e1 ff ff       	call   f0100115 <_panic>
	assert(pp2->pp_ref == 0);
f0101fea:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0101fed:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f0101ff1:	66 85 c0             	test   %ax,%ax
f0101ff4:	74 24                	je     f010201a <page_check+0x6b2>
f0101ff6:	c7 44 24 0c 39 3f 10 	movl   $0xf0103f39,0xc(%esp)
f0101ffd:	f0 
f0101ffe:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102005:	f0 
f0102006:	c7 44 24 04 a8 02 00 	movl   $0x2a8,0x4(%esp)
f010200d:	00 
f010200e:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102015:	e8 fb e0 ff ff       	call   f0100115 <_panic>

	// pp2 should be returned by page_alloc
	assert(page_alloc(&pp) == 0 && pp == pp2);
f010201a:	8d 45 f8             	lea    -0x8(%ebp),%eax
f010201d:	89 04 24             	mov    %eax,(%esp)
f0102020:	e8 2d f8 ff ff       	call   f0101852 <page_alloc>
f0102025:	85 c0                	test   %eax,%eax
f0102027:	75 0a                	jne    f0102033 <page_check+0x6cb>
f0102029:	8b 55 f8             	mov    -0x8(%ebp),%edx
f010202c:	8b 45 ec             	mov    -0x14(%ebp),%eax
f010202f:	39 c2                	cmp    %eax,%edx
f0102031:	74 24                	je     f0102057 <page_check+0x6ef>
f0102033:	c7 44 24 0c 4c 3f 10 	movl   $0xf0103f4c,0xc(%esp)
f010203a:	f0 
f010203b:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102042:	f0 
f0102043:	c7 44 24 04 ab 02 00 	movl   $0x2ab,0x4(%esp)
f010204a:	00 
f010204b:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102052:	e8 be e0 ff ff       	call   f0100115 <_panic>

	// unmapping pp1 at 0 should keep pp1 at PGSIZE
	page_remove(boot_pgdir, 0x0);
f0102057:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f010205c:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0102063:	00 
f0102064:	89 04 24             	mov    %eax,(%esp)
f0102067:	e8 e3 f8 ff ff       	call   f010194f <page_remove>
	assert(check_va2pa(boot_pgdir, 0x0) == ~0);
f010206c:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f0102071:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0102078:	00 
f0102079:	89 04 24             	mov    %eax,(%esp)
f010207c:	e8 0d f5 ff ff       	call   f010158e <check_va2pa>
f0102081:	83 f8 ff             	cmp    $0xffffffff,%eax
f0102084:	74 24                	je     f01020aa <page_check+0x742>
f0102086:	c7 44 24 0c 70 3f 10 	movl   $0xf0103f70,0xc(%esp)
f010208d:	f0 
f010208e:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102095:	f0 
f0102096:	c7 44 24 04 af 02 00 	movl   $0x2af,0x4(%esp)
f010209d:	00 
f010209e:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01020a5:	e8 6b e0 ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, PGSIZE) == page2pa(pp1));
f01020aa:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f01020af:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f01020b6:	00 
f01020b7:	89 04 24             	mov    %eax,(%esp)
f01020ba:	e8 cf f4 ff ff       	call   f010158e <check_va2pa>
f01020bf:	89 c3                	mov    %eax,%ebx
f01020c1:	8b 45 f0             	mov    -0x10(%ebp),%eax
f01020c4:	89 04 24             	mov    %eax,(%esp)
f01020c7:	e8 ad 02 00 00       	call   f0102379 <page2pa>
f01020cc:	39 c3                	cmp    %eax,%ebx
f01020ce:	74 24                	je     f01020f4 <page_check+0x78c>
f01020d0:	c7 44 24 0c f8 3e 10 	movl   $0xf0103ef8,0xc(%esp)
f01020d7:	f0 
f01020d8:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01020df:	f0 
f01020e0:	c7 44 24 04 b0 02 00 	movl   $0x2b0,0x4(%esp)
f01020e7:	00 
f01020e8:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01020ef:	e8 21 e0 ff ff       	call   f0100115 <_panic>
	assert(pp1->pp_ref == 1);
f01020f4:	8b 45 f0             	mov    -0x10(%ebp),%eax
f01020f7:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f01020fb:	66 83 f8 01          	cmp    $0x1,%ax
f01020ff:	74 24                	je     f0102125 <page_check+0x7bd>
f0102101:	c7 44 24 0c c1 3d 10 	movl   $0xf0103dc1,0xc(%esp)
f0102108:	f0 
f0102109:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102110:	f0 
f0102111:	c7 44 24 04 b1 02 00 	movl   $0x2b1,0x4(%esp)
f0102118:	00 
f0102119:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102120:	e8 f0 df ff ff       	call   f0100115 <_panic>
	assert(pp2->pp_ref == 0);
f0102125:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102128:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f010212c:	66 85 c0             	test   %ax,%ax
f010212f:	74 24                	je     f0102155 <page_check+0x7ed>
f0102131:	c7 44 24 0c 39 3f 10 	movl   $0xf0103f39,0xc(%esp)
f0102138:	f0 
f0102139:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102140:	f0 
f0102141:	c7 44 24 04 b2 02 00 	movl   $0x2b2,0x4(%esp)
f0102148:	00 
f0102149:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102150:	e8 c0 df ff ff       	call   f0100115 <_panic>

	// unmapping pp1 at PGSIZE should free it
	page_remove(boot_pgdir, (void*) PGSIZE);
f0102155:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f010215a:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f0102161:	00 
f0102162:	89 04 24             	mov    %eax,(%esp)
f0102165:	e8 e5 f7 ff ff       	call   f010194f <page_remove>
	assert(check_va2pa(boot_pgdir, 0x0) == ~0);
f010216a:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f010216f:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
f0102176:	00 
f0102177:	89 04 24             	mov    %eax,(%esp)
f010217a:	e8 0f f4 ff ff       	call   f010158e <check_va2pa>
f010217f:	83 f8 ff             	cmp    $0xffffffff,%eax
f0102182:	74 24                	je     f01021a8 <page_check+0x840>
f0102184:	c7 44 24 0c 70 3f 10 	movl   $0xf0103f70,0xc(%esp)
f010218b:	f0 
f010218c:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102193:	f0 
f0102194:	c7 44 24 04 b6 02 00 	movl   $0x2b6,0x4(%esp)
f010219b:	00 
f010219c:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01021a3:	e8 6d df ff ff       	call   f0100115 <_panic>
	assert(check_va2pa(boot_pgdir, PGSIZE) == ~0);
f01021a8:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f01021ad:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
f01021b4:	00 
f01021b5:	89 04 24             	mov    %eax,(%esp)
f01021b8:	e8 d1 f3 ff ff       	call   f010158e <check_va2pa>
f01021bd:	83 f8 ff             	cmp    $0xffffffff,%eax
f01021c0:	74 24                	je     f01021e6 <page_check+0x87e>
f01021c2:	c7 44 24 0c 94 3f 10 	movl   $0xf0103f94,0xc(%esp)
f01021c9:	f0 
f01021ca:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01021d1:	f0 
f01021d2:	c7 44 24 04 b7 02 00 	movl   $0x2b7,0x4(%esp)
f01021d9:	00 
f01021da:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01021e1:	e8 2f df ff ff       	call   f0100115 <_panic>
	assert(pp1->pp_ref == 0);
f01021e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
f01021e9:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f01021ed:	66 85 c0             	test   %ax,%ax
f01021f0:	74 24                	je     f0102216 <page_check+0x8ae>
f01021f2:	c7 44 24 0c ba 3f 10 	movl   $0xf0103fba,0xc(%esp)
f01021f9:	f0 
f01021fa:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102201:	f0 
f0102202:	c7 44 24 04 b8 02 00 	movl   $0x2b8,0x4(%esp)
f0102209:	00 
f010220a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102211:	e8 ff de ff ff       	call   f0100115 <_panic>
	assert(pp2->pp_ref == 0);
f0102216:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102219:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f010221d:	66 85 c0             	test   %ax,%ax
f0102220:	74 24                	je     f0102246 <page_check+0x8de>
f0102222:	c7 44 24 0c 39 3f 10 	movl   $0xf0103f39,0xc(%esp)
f0102229:	f0 
f010222a:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102231:	f0 
f0102232:	c7 44 24 04 b9 02 00 	movl   $0x2b9,0x4(%esp)
f0102239:	00 
f010223a:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102241:	e8 cf de ff ff       	call   f0100115 <_panic>

	// so it should be returned by page_alloc
	assert(page_alloc(&pp) == 0 && pp == pp1);
f0102246:	8d 45 f8             	lea    -0x8(%ebp),%eax
f0102249:	89 04 24             	mov    %eax,(%esp)
f010224c:	e8 01 f6 ff ff       	call   f0101852 <page_alloc>
f0102251:	85 c0                	test   %eax,%eax
f0102253:	75 0a                	jne    f010225f <page_check+0x8f7>
f0102255:	8b 55 f8             	mov    -0x8(%ebp),%edx
f0102258:	8b 45 f0             	mov    -0x10(%ebp),%eax
f010225b:	39 c2                	cmp    %eax,%edx
f010225d:	74 24                	je     f0102283 <page_check+0x91b>
f010225f:	c7 44 24 0c cc 3f 10 	movl   $0xf0103fcc,0xc(%esp)
f0102266:	f0 
f0102267:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f010226e:	f0 
f010226f:	c7 44 24 04 bc 02 00 	movl   $0x2bc,0x4(%esp)
f0102276:	00 
f0102277:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f010227e:	e8 92 de ff ff       	call   f0100115 <_panic>

	// should be no free memory
	assert(page_alloc(&pp) == -E_NO_MEM);
f0102283:	8d 45 f8             	lea    -0x8(%ebp),%eax
f0102286:	89 04 24             	mov    %eax,(%esp)
f0102289:	e8 c4 f5 ff ff       	call   f0101852 <page_alloc>
f010228e:	83 f8 fc             	cmp    $0xfffffffc,%eax
f0102291:	74 24                	je     f01022b7 <page_check+0x94f>
f0102293:	c7 44 24 0c f4 3c 10 	movl   $0xf0103cf4,0xc(%esp)
f010229a:	f0 
f010229b:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01022a2:	f0 
f01022a3:	c7 44 24 04 bf 02 00 	movl   $0x2bf,0x4(%esp)
f01022aa:	00 
f01022ab:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01022b2:	e8 5e de ff ff       	call   f0100115 <_panic>

	// forcibly take pp0 back
	assert(PTE_ADDR(boot_pgdir[0]) == page2pa(pp0));
f01022b7:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f01022bc:	8b 00                	mov    (%eax),%eax
f01022be:	89 c3                	mov    %eax,%ebx
f01022c0:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
f01022c6:	8b 45 f4             	mov    -0xc(%ebp),%eax
f01022c9:	89 04 24             	mov    %eax,(%esp)
f01022cc:	e8 a8 00 00 00       	call   f0102379 <page2pa>
f01022d1:	39 c3                	cmp    %eax,%ebx
f01022d3:	74 24                	je     f01022f9 <page_check+0x991>
f01022d5:	c7 44 24 0c 6c 3d 10 	movl   $0xf0103d6c,0xc(%esp)
f01022dc:	f0 
f01022dd:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f01022e4:	f0 
f01022e5:	c7 44 24 04 c2 02 00 	movl   $0x2c2,0x4(%esp)
f01022ec:	00 
f01022ed:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f01022f4:	e8 1c de ff ff       	call   f0100115 <_panic>
	boot_pgdir[0] = 0;
f01022f9:	a1 28 3c 11 f0       	mov    0xf0113c28,%eax
f01022fe:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	assert(pp0->pp_ref == 1);
f0102304:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102307:	0f b7 40 08          	movzwl 0x8(%eax),%eax
f010230b:	66 83 f8 01          	cmp    $0x1,%ax
f010230f:	74 24                	je     f0102335 <page_check+0x9cd>
f0102311:	c7 44 24 0c d2 3d 10 	movl   $0xf0103dd2,0xc(%esp)
f0102318:	f0 
f0102319:	c7 44 24 08 c3 3b 10 	movl   $0xf0103bc3,0x8(%esp)
f0102320:	f0 
f0102321:	c7 44 24 04 c4 02 00 	movl   $0x2c4,0x4(%esp)
f0102328:	00 
f0102329:	c7 04 24 5f 3b 10 f0 	movl   $0xf0103b5f,(%esp)
f0102330:	e8 e0 dd ff ff       	call   f0100115 <_panic>
	pp0->pp_ref = 0;
f0102335:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102338:	66 c7 40 08 00 00    	movw   $0x0,0x8(%eax)

	// give free list back
	page_free_list = fl;
f010233e:	8b 45 e8             	mov    -0x18(%ebp),%eax
f0102341:	a3 18 38 11 f0       	mov    %eax,0xf0113818

	// free the pages we took
	page_free(pp0);
f0102346:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102349:	89 04 24             	mov    %eax,(%esp)
f010234c:	e8 6b f5 ff ff       	call   f01018bc <page_free>
	page_free(pp1);
f0102351:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0102354:	89 04 24             	mov    %eax,(%esp)
f0102357:	e8 60 f5 ff ff       	call   f01018bc <page_free>
	page_free(pp2);
f010235c:	8b 45 ec             	mov    -0x14(%ebp),%eax
f010235f:	89 04 24             	mov    %eax,(%esp)
f0102362:	e8 55 f5 ff ff       	call   f01018bc <page_free>

	cprintf("page_check() succeeded!\n");
f0102367:	c7 04 24 ee 3f 10 f0 	movl   $0xf0103fee,(%esp)
f010236e:	e8 f4 00 00 00       	call   f0102467 <cprintf>
}
f0102373:	83 c4 34             	add    $0x34,%esp
f0102376:	5b                   	pop    %ebx
f0102377:	5d                   	pop    %ebp
f0102378:	c3                   	ret    

f0102379 <page2pa>:
	return pp - pages;
}

static inline physaddr_t
page2pa(struct Page *pp)
{
f0102379:	55                   	push   %ebp
f010237a:	89 e5                	mov    %esp,%ebp
f010237c:	83 ec 08             	sub    $0x8,%esp
	return page2ppn(pp) << PGSHIFT;
f010237f:	8b 45 08             	mov    0x8(%ebp),%eax
f0102382:	89 04 24             	mov    %eax,(%esp)
f0102385:	e8 05 00 00 00       	call   f010238f <page2ppn>
f010238a:	c1 e0 0c             	shl    $0xc,%eax
}
f010238d:	c9                   	leave  
f010238e:	c3                   	ret    

f010238f <page2ppn>:
void	page_decref(struct Page *pp);
void	tlb_invalidate(pde_t *pgdir, void *va);

static inline ppn_t
page2ppn(struct Page *pp)
{
f010238f:	55                   	push   %ebp
f0102390:	89 e5                	mov    %esp,%ebp
	return pp - pages;
f0102392:	8b 55 08             	mov    0x8(%ebp),%edx
f0102395:	a1 2c 3c 11 f0       	mov    0xf0113c2c,%eax
f010239a:	89 d1                	mov    %edx,%ecx
f010239c:	29 c1                	sub    %eax,%ecx
f010239e:	89 c8                	mov    %ecx,%eax
f01023a0:	c1 f8 02             	sar    $0x2,%eax
f01023a3:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
}
f01023a9:	5d                   	pop    %ebp
f01023aa:	c3                   	ret    
	...

f01023ac <mc146818_read>:
#include <kern/kclock.h>


unsigned
mc146818_read(unsigned reg)
{
f01023ac:	55                   	push   %ebp
f01023ad:	89 e5                	mov    %esp,%ebp
f01023af:	83 ec 10             	sub    $0x10,%esp
	outb(IO_RTC, reg);
f01023b2:	8b 45 08             	mov    0x8(%ebp),%eax
f01023b5:	0f b6 c0             	movzbl %al,%eax
f01023b8:	c7 45 f4 70 00 00 00 	movl   $0x70,-0xc(%ebp)
f01023bf:	88 45 f3             	mov    %al,-0xd(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f01023c2:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
f01023c6:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01023c9:	ee                   	out    %al,(%dx)
f01023ca:	c7 45 f8 71 00 00 00 	movl   $0x71,-0x8(%ebp)

static __inline uint8_t
inb(int port)
{
	uint8_t data;
	__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01023d1:	8b 55 f8             	mov    -0x8(%ebp),%edx
f01023d4:	ec                   	in     (%dx),%al
f01023d5:	88 45 ff             	mov    %al,-0x1(%ebp)
	return data;
f01023d8:	0f b6 45 ff          	movzbl -0x1(%ebp),%eax
	return inb(IO_RTC+1);
f01023dc:	0f b6 c0             	movzbl %al,%eax
}
f01023df:	c9                   	leave  
f01023e0:	c3                   	ret    

f01023e1 <mc146818_write>:

void
mc146818_write(unsigned reg, unsigned datum)
{
f01023e1:	55                   	push   %ebp
f01023e2:	89 e5                	mov    %esp,%ebp
f01023e4:	83 ec 10             	sub    $0x10,%esp
	outb(IO_RTC, reg);
f01023e7:	8b 45 08             	mov    0x8(%ebp),%eax
f01023ea:	0f b6 c0             	movzbl %al,%eax
f01023ed:	c7 45 f4 70 00 00 00 	movl   $0x70,-0xc(%ebp)
f01023f4:	88 45 f3             	mov    %al,-0xd(%ebp)
}

static __inline void
outb(int port, uint8_t data)
{
	__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
f01023f7:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
f01023fb:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01023fe:	ee                   	out    %al,(%dx)
	outb(IO_RTC+1, datum);
f01023ff:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102402:	0f b6 c0             	movzbl %al,%eax
f0102405:	c7 45 fc 71 00 00 00 	movl   $0x71,-0x4(%ebp)
f010240c:	88 45 fb             	mov    %al,-0x5(%ebp)
f010240f:	0f b6 45 fb          	movzbl -0x5(%ebp),%eax
f0102413:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0102416:	ee                   	out    %al,(%dx)
}
f0102417:	c9                   	leave  
f0102418:	c3                   	ret    
f0102419:	00 00                	add    %al,(%eax)
	...

f010241c <putch>:
#include <inc/stdarg.h>


static void
putch(int ch, int *cnt)
{
f010241c:	55                   	push   %ebp
f010241d:	89 e5                	mov    %esp,%ebp
f010241f:	83 ec 08             	sub    $0x8,%esp
	cputchar(ch);
f0102422:	8b 45 08             	mov    0x8(%ebp),%eax
f0102425:	89 04 24             	mov    %eax,(%esp)
f0102428:	e8 1b e5 ff ff       	call   f0100948 <cputchar>
	*cnt++;
f010242d:	83 45 0c 04          	addl   $0x4,0xc(%ebp)
}
f0102431:	c9                   	leave  
f0102432:	c3                   	ret    

f0102433 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
f0102433:	55                   	push   %ebp
f0102434:	89 e5                	mov    %esp,%ebp
f0102436:	83 ec 28             	sub    $0x28,%esp
	int cnt = 0;
f0102439:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)

	vprintfmt((void*)putch, &cnt, fmt, ap);
f0102440:	ba 1c 24 10 f0       	mov    $0xf010241c,%edx
f0102445:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102448:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010244c:	8b 45 08             	mov    0x8(%ebp),%eax
f010244f:	89 44 24 08          	mov    %eax,0x8(%esp)
f0102453:	8d 45 fc             	lea    -0x4(%ebp),%eax
f0102456:	89 44 24 04          	mov    %eax,0x4(%esp)
f010245a:	89 14 24             	mov    %edx,(%esp)
f010245d:	e8 b5 05 00 00       	call   f0102a17 <vprintfmt>
	return cnt;
f0102462:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0102465:	c9                   	leave  
f0102466:	c3                   	ret    

f0102467 <cprintf>:

int
cprintf(const char *fmt, ...)
{
f0102467:	55                   	push   %ebp
f0102468:	89 e5                	mov    %esp,%ebp
f010246a:	83 ec 18             	sub    $0x18,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
f010246d:	8d 45 08             	lea    0x8(%ebp),%eax
f0102470:	83 c0 04             	add    $0x4,%eax
f0102473:	89 45 f8             	mov    %eax,-0x8(%ebp)
	cnt = vcprintf(fmt, ap);
f0102476:	8b 55 08             	mov    0x8(%ebp),%edx
f0102479:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010247c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102480:	89 14 24             	mov    %edx,(%esp)
f0102483:	e8 ab ff ff ff       	call   f0102433 <vcprintf>
f0102488:	89 45 fc             	mov    %eax,-0x4(%ebp)
	va_end(ap);

	return cnt;
f010248b:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f010248e:	c9                   	leave  
f010248f:	c3                   	ret    

f0102490 <stab_binsearch>:
extern const struct Stab __STAB_BEGIN__[], __STAB_END__[];
extern const char __STABSTR_BEGIN__[], __STABSTR_END__[];

static void
stab_binsearch(const struct Stab *stabs, uintptr_t addr, int *lx, int *rx, int type)
{
f0102490:	55                   	push   %ebp
f0102491:	89 e5                	mov    %esp,%ebp
f0102493:	83 ec 10             	sub    $0x10,%esp
	int l = *lx, r = *rx;
f0102496:	8b 45 10             	mov    0x10(%ebp),%eax
f0102499:	8b 00                	mov    (%eax),%eax
f010249b:	89 45 f4             	mov    %eax,-0xc(%ebp)
f010249e:	8b 45 14             	mov    0x14(%ebp),%eax
f01024a1:	8b 00                	mov    (%eax),%eax
f01024a3:	89 45 f8             	mov    %eax,-0x8(%ebp)
f01024a6:	e9 c6 00 00 00       	jmp    f0102571 <stab_binsearch+0xe1>
	
	while (l <= r) {
		int m = (l + r) / 2;
f01024ab:	8b 55 f8             	mov    -0x8(%ebp),%edx
f01024ae:	8b 45 f4             	mov    -0xc(%ebp),%eax
f01024b1:	8d 14 10             	lea    (%eax,%edx,1),%edx
f01024b4:	89 d0                	mov    %edx,%eax
f01024b6:	c1 e8 1f             	shr    $0x1f,%eax
f01024b9:	01 d0                	add    %edx,%eax
f01024bb:	d1 f8                	sar    %eax
f01024bd:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01024c0:	eb 04                	jmp    f01024c6 <stab_binsearch+0x36>
		while (m >= l && stabs[m].n_type != type)
			m--;
f01024c2:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
{
	int l = *lx, r = *rx;
	
	while (l <= r) {
		int m = (l + r) / 2;
		while (m >= l && stabs[m].n_type != type)
f01024c6:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01024c9:	3b 45 f4             	cmp    -0xc(%ebp),%eax
f01024cc:	7c 1b                	jl     f01024e9 <stab_binsearch+0x59>
f01024ce:	8b 55 fc             	mov    -0x4(%ebp),%edx
f01024d1:	89 d0                	mov    %edx,%eax
f01024d3:	01 c0                	add    %eax,%eax
f01024d5:	01 d0                	add    %edx,%eax
f01024d7:	c1 e0 02             	shl    $0x2,%eax
f01024da:	03 45 08             	add    0x8(%ebp),%eax
f01024dd:	0f b6 40 04          	movzbl 0x4(%eax),%eax
f01024e1:	0f b6 c0             	movzbl %al,%eax
f01024e4:	3b 45 18             	cmp    0x18(%ebp),%eax
f01024e7:	75 d9                	jne    f01024c2 <stab_binsearch+0x32>
			m--;
		if (m < l)
f01024e9:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01024ec:	3b 45 f4             	cmp    -0xc(%ebp),%eax
f01024ef:	7d 1a                	jge    f010250b <stab_binsearch+0x7b>
			l = (l + r) / 2 + 1;
f01024f1:	8b 55 f8             	mov    -0x8(%ebp),%edx
f01024f4:	8b 45 f4             	mov    -0xc(%ebp),%eax
f01024f7:	8d 14 10             	lea    (%eax,%edx,1),%edx
f01024fa:	89 d0                	mov    %edx,%eax
f01024fc:	c1 e8 1f             	shr    $0x1f,%eax
f01024ff:	01 d0                	add    %edx,%eax
f0102501:	d1 f8                	sar    %eax
f0102503:	83 c0 01             	add    $0x1,%eax
f0102506:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0102509:	eb 66                	jmp    f0102571 <stab_binsearch+0xe1>
		else if (stabs[m].n_value < addr) {
f010250b:	8b 55 fc             	mov    -0x4(%ebp),%edx
f010250e:	89 d0                	mov    %edx,%eax
f0102510:	01 c0                	add    %eax,%eax
f0102512:	01 d0                	add    %edx,%eax
f0102514:	c1 e0 02             	shl    $0x2,%eax
f0102517:	03 45 08             	add    0x8(%ebp),%eax
f010251a:	8b 40 08             	mov    0x8(%eax),%eax
f010251d:	3b 45 0c             	cmp    0xc(%ebp),%eax
f0102520:	73 13                	jae    f0102535 <stab_binsearch+0xa5>
			*lx = m;
f0102522:	8b 55 10             	mov    0x10(%ebp),%edx
f0102525:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0102528:	89 02                	mov    %eax,(%edx)
			l = m + 1;
f010252a:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010252d:	83 c0 01             	add    $0x1,%eax
f0102530:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0102533:	eb 3c                	jmp    f0102571 <stab_binsearch+0xe1>
		} else if (stabs[m].n_value > addr) {
f0102535:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0102538:	89 d0                	mov    %edx,%eax
f010253a:	01 c0                	add    %eax,%eax
f010253c:	01 d0                	add    %edx,%eax
f010253e:	c1 e0 02             	shl    $0x2,%eax
f0102541:	03 45 08             	add    0x8(%ebp),%eax
f0102544:	8b 40 08             	mov    0x8(%eax),%eax
f0102547:	3b 45 0c             	cmp    0xc(%ebp),%eax
f010254a:	76 13                	jbe    f010255f <stab_binsearch+0xcf>
			*rx = m;
f010254c:	8b 55 14             	mov    0x14(%ebp),%edx
f010254f:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0102552:	89 02                	mov    %eax,(%edx)
			r = m - 1;
f0102554:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0102557:	83 e8 01             	sub    $0x1,%eax
f010255a:	89 45 f8             	mov    %eax,-0x8(%ebp)
f010255d:	eb 12                	jmp    f0102571 <stab_binsearch+0xe1>
		} else {
			*lx = m;
f010255f:	8b 45 10             	mov    0x10(%ebp),%eax
f0102562:	8b 55 fc             	mov    -0x4(%ebp),%edx
f0102565:	89 10                	mov    %edx,(%eax)
			l = m;
f0102567:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010256a:	89 45 f4             	mov    %eax,-0xc(%ebp)
			addr++;
f010256d:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
static void
stab_binsearch(const struct Stab *stabs, uintptr_t addr, int *lx, int *rx, int type)
{
	int l = *lx, r = *rx;
	
	while (l <= r) {
f0102571:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102574:	3b 45 f8             	cmp    -0x8(%ebp),%eax
f0102577:	0f 8e 2e ff ff ff    	jle    f01024ab <stab_binsearch+0x1b>
			*lx = m;
			l = m;
			addr++;
		}
	}
}
f010257d:	c9                   	leave  
f010257e:	c3                   	ret    

f010257f <debuginfo_eip>:


int
debuginfo_eip(uintptr_t addr, struct Eipdebuginfo *info)
{
f010257f:	55                   	push   %ebp
f0102580:	89 e5                	mov    %esp,%ebp
f0102582:	53                   	push   %ebx
f0102583:	83 ec 54             	sub    $0x54,%esp
	const struct Stab *stabs, *stab_end;
	const char *stabstr, *stabstr_end;
	int lfile, rfile, lfun, rfun, lline, rline;

	info->eip_fn = "<unknown>";
f0102586:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102589:	c7 00 07 40 10 f0    	movl   $0xf0104007,(%eax)
	info->eip_fnaddr = addr;
f010258f:	8b 55 0c             	mov    0xc(%ebp),%edx
f0102592:	8b 45 08             	mov    0x8(%ebp),%eax
f0102595:	89 42 08             	mov    %eax,0x8(%edx)
	info->eip_fnlen = 9;
f0102598:	8b 45 0c             	mov    0xc(%ebp),%eax
f010259b:	c7 40 04 09 00 00 00 	movl   $0x9,0x4(%eax)
	info->eip_file = "<unknown>";
f01025a2:	8b 45 0c             	mov    0xc(%ebp),%eax
f01025a5:	c7 40 0c 07 40 10 f0 	movl   $0xf0104007,0xc(%eax)
	info->eip_line = 0;
f01025ac:	8b 45 0c             	mov    0xc(%ebp),%eax
f01025af:	c7 40 10 00 00 00 00 	movl   $0x0,0x10(%eax)

	if (addr >= KERNBASE) {
f01025b6:	81 7d 08 ff ff ff ef 	cmpl   $0xefffffff,0x8(%ebp)
f01025bd:	76 6f                	jbe    f010262e <debuginfo_eip+0xaf>
		stabs = __STAB_BEGIN__;
f01025bf:	c7 45 e4 70 42 10 f0 	movl   $0xf0104270,-0x1c(%ebp)
		stab_end = __STAB_END__;
f01025c6:	c7 45 e8 78 91 10 f0 	movl   $0xf0109178,-0x18(%ebp)
		stabstr = __STABSTR_BEGIN__;
f01025cd:	c7 45 ec 79 91 10 f0 	movl   $0xf0109179,-0x14(%ebp)
		stabstr_end = __STABSTR_END__;
f01025d4:	c7 45 f0 34 af 10 f0 	movl   $0xf010af34,-0x10(%ebp)
	} else {
  	        panic ("User address");
	}

	lfile = 0, rfile = stab_end - stabs - 1;
f01025db:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
f01025e2:	8b 55 e8             	mov    -0x18(%ebp),%edx
f01025e5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f01025e8:	89 d1                	mov    %edx,%ecx
f01025ea:	29 c1                	sub    %eax,%ecx
f01025ec:	89 c8                	mov    %ecx,%eax
f01025ee:	c1 f8 02             	sar    $0x2,%eax
f01025f1:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
f01025f7:	83 e8 01             	sub    $0x1,%eax
f01025fa:	89 45 dc             	mov    %eax,-0x24(%ebp)
	stab_binsearch(stabs, addr, &lfile, &rfile, N_SO);
f01025fd:	c7 44 24 10 64 00 00 	movl   $0x64,0x10(%esp)
f0102604:	00 
f0102605:	8d 45 dc             	lea    -0x24(%ebp),%eax
f0102608:	89 44 24 0c          	mov    %eax,0xc(%esp)
f010260c:	8d 45 e0             	lea    -0x20(%ebp),%eax
f010260f:	89 44 24 08          	mov    %eax,0x8(%esp)
f0102613:	8b 45 08             	mov    0x8(%ebp),%eax
f0102616:	89 44 24 04          	mov    %eax,0x4(%esp)
f010261a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f010261d:	89 04 24             	mov    %eax,(%esp)
f0102620:	e8 6b fe ff ff       	call   f0102490 <stab_binsearch>
	if (lfile == 0)
f0102625:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102628:	85 c0                	test   %eax,%eax
f010262a:	74 1e                	je     f010264a <debuginfo_eip+0xcb>
f010262c:	eb 28                	jmp    f0102656 <debuginfo_eip+0xd7>
		stabs = __STAB_BEGIN__;
		stab_end = __STAB_END__;
		stabstr = __STABSTR_BEGIN__;
		stabstr_end = __STABSTR_END__;
	} else {
  	        panic ("User address");
f010262e:	c7 44 24 08 11 40 10 	movl   $0xf0104011,0x8(%esp)
f0102635:	f0 
f0102636:	c7 44 24 04 40 00 00 	movl   $0x40,0x4(%esp)
f010263d:	00 
f010263e:	c7 04 24 1e 40 10 f0 	movl   $0xf010401e,(%esp)
f0102645:	e8 cb da ff ff       	call   f0100115 <_panic>
	}

	lfile = 0, rfile = stab_end - stabs - 1;
	stab_binsearch(stabs, addr, &lfile, &rfile, N_SO);
	if (lfile == 0)
		return -1;
f010264a:	c7 45 c8 ff ff ff ff 	movl   $0xffffffff,-0x38(%ebp)
f0102651:	e9 c5 01 00 00       	jmp    f010281b <debuginfo_eip+0x29c>

	lfun = lfile, rfun = rfile;
f0102656:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102659:	89 45 d8             	mov    %eax,-0x28(%ebp)
f010265c:	8b 45 dc             	mov    -0x24(%ebp),%eax
f010265f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
	stab_binsearch(stabs, addr, &lfun, &rfun, N_FUN);
f0102662:	c7 44 24 10 24 00 00 	movl   $0x24,0x10(%esp)
f0102669:	00 
f010266a:	8d 45 d4             	lea    -0x2c(%ebp),%eax
f010266d:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0102671:	8d 45 d8             	lea    -0x28(%ebp),%eax
f0102674:	89 44 24 08          	mov    %eax,0x8(%esp)
f0102678:	8b 45 08             	mov    0x8(%ebp),%eax
f010267b:	89 44 24 04          	mov    %eax,0x4(%esp)
f010267f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
f0102682:	89 04 24             	mov    %eax,(%esp)
f0102685:	e8 06 fe ff ff       	call   f0102490 <stab_binsearch>

	/* At this point we know the function name. */
	if (lfun != lfile) {
f010268a:	8b 55 d8             	mov    -0x28(%ebp),%edx
f010268d:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102690:	39 c2                	cmp    %eax,%edx
f0102692:	74 71                	je     f0102705 <debuginfo_eip+0x186>
		if (stabs[lfun].n_strx < stabstr_end - stabstr)
f0102694:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0102697:	89 c2                	mov    %eax,%edx
f0102699:	89 d0                	mov    %edx,%eax
f010269b:	01 c0                	add    %eax,%eax
f010269d:	01 d0                	add    %edx,%eax
f010269f:	c1 e0 02             	shl    $0x2,%eax
f01026a2:	03 45 e4             	add    -0x1c(%ebp),%eax
f01026a5:	8b 08                	mov    (%eax),%ecx
f01026a7:	8b 55 f0             	mov    -0x10(%ebp),%edx
f01026aa:	8b 45 ec             	mov    -0x14(%ebp),%eax
f01026ad:	89 d3                	mov    %edx,%ebx
f01026af:	29 c3                	sub    %eax,%ebx
f01026b1:	89 d8                	mov    %ebx,%eax
f01026b3:	39 c1                	cmp    %eax,%ecx
f01026b5:	73 1d                	jae    f01026d4 <debuginfo_eip+0x155>
			info->eip_fn = stabstr + stabs[lfun].n_strx;
f01026b7:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01026ba:	89 c2                	mov    %eax,%edx
f01026bc:	89 d0                	mov    %edx,%eax
f01026be:	01 c0                	add    %eax,%eax
f01026c0:	01 d0                	add    %edx,%eax
f01026c2:	c1 e0 02             	shl    $0x2,%eax
f01026c5:	03 45 e4             	add    -0x1c(%ebp),%eax
f01026c8:	8b 00                	mov    (%eax),%eax
f01026ca:	89 c2                	mov    %eax,%edx
f01026cc:	03 55 ec             	add    -0x14(%ebp),%edx
f01026cf:	8b 45 0c             	mov    0xc(%ebp),%eax
f01026d2:	89 10                	mov    %edx,(%eax)
		info->eip_fnaddr = stabs[lfun].n_value;
f01026d4:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01026d7:	89 c2                	mov    %eax,%edx
f01026d9:	89 d0                	mov    %edx,%eax
f01026db:	01 c0                	add    %eax,%eax
f01026dd:	01 d0                	add    %edx,%eax
f01026df:	c1 e0 02             	shl    $0x2,%eax
f01026e2:	03 45 e4             	add    -0x1c(%ebp),%eax
f01026e5:	8b 50 08             	mov    0x8(%eax),%edx
f01026e8:	8b 45 0c             	mov    0xc(%ebp),%eax
f01026eb:	89 50 08             	mov    %edx,0x8(%eax)
		addr -= info->eip_fnaddr;
f01026ee:	8b 45 0c             	mov    0xc(%ebp),%eax
f01026f1:	8b 40 08             	mov    0x8(%eax),%eax
f01026f4:	29 45 08             	sub    %eax,0x8(%ebp)
		lline = lfun, rline = rfun;
f01026f7:	8b 45 d8             	mov    -0x28(%ebp),%eax
f01026fa:	89 45 f4             	mov    %eax,-0xc(%ebp)
f01026fd:	8b 45 d4             	mov    -0x2c(%ebp),%eax
f0102700:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0102703:	eb 26                	jmp    f010272b <debuginfo_eip+0x1ac>
	} else {
		info->eip_fn = info->eip_file;
f0102705:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102708:	8b 50 0c             	mov    0xc(%eax),%edx
f010270b:	8b 45 0c             	mov    0xc(%ebp),%eax
f010270e:	89 10                	mov    %edx,(%eax)
		info->eip_fnaddr = addr;
f0102710:	8b 55 0c             	mov    0xc(%ebp),%edx
f0102713:	8b 45 08             	mov    0x8(%ebp),%eax
f0102716:	89 42 08             	mov    %eax,0x8(%edx)
		lline = lfun = lfile, rline = rfile;
f0102719:	8b 45 e0             	mov    -0x20(%ebp),%eax
f010271c:	89 45 d8             	mov    %eax,-0x28(%ebp)
f010271f:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0102722:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0102725:	8b 45 dc             	mov    -0x24(%ebp),%eax
f0102728:	89 45 f8             	mov    %eax,-0x8(%ebp)
	}
	info->eip_fnlen = strfind(info->eip_fn, ':') - info->eip_fn;
f010272b:	8b 45 0c             	mov    0xc(%ebp),%eax
f010272e:	8b 00                	mov    (%eax),%eax
f0102730:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
f0102737:	00 
f0102738:	89 04 24             	mov    %eax,(%esp)
f010273b:	e8 24 0b 00 00       	call   f0103264 <strfind>
f0102740:	89 c2                	mov    %eax,%edx
f0102742:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102745:	8b 00                	mov    (%eax),%eax
f0102747:	29 c2                	sub    %eax,%edx
f0102749:	8b 45 0c             	mov    0xc(%ebp),%eax
f010274c:	89 50 04             	mov    %edx,0x4(%eax)

	/* Search for the line number: */
	// You code here
	if (lline == 0)
f010274f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
f0102753:	75 0c                	jne    f0102761 <debuginfo_eip+0x1e2>
		return -1;
f0102755:	c7 45 c8 ff ff ff ff 	movl   $0xffffffff,-0x38(%ebp)
f010275c:	e9 ba 00 00 00       	jmp    f010281b <debuginfo_eip+0x29c>

	/* Found line number, store it and search backwards for filename */
	info->eip_line = stabs[lline].n_desc;
f0102761:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0102764:	89 d0                	mov    %edx,%eax
f0102766:	01 c0                	add    %eax,%eax
f0102768:	01 d0                	add    %edx,%eax
f010276a:	c1 e0 02             	shl    $0x2,%eax
f010276d:	03 45 e4             	add    -0x1c(%ebp),%eax
f0102770:	0f b7 40 06          	movzwl 0x6(%eax),%eax
f0102774:	0f b7 d0             	movzwl %ax,%edx
f0102777:	8b 45 0c             	mov    0xc(%ebp),%eax
f010277a:	89 50 10             	mov    %edx,0x10(%eax)
f010277d:	eb 04                	jmp    f0102783 <debuginfo_eip+0x204>
	while (lline >= lfile && stabs[lline].n_type != N_SOL && (stabs[lline].n_type != N_SO || !stabs[lline].n_value))
		lline--;
f010277f:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
	if (lline == 0)
		return -1;

	/* Found line number, store it and search backwards for filename */
	info->eip_line = stabs[lline].n_desc;
	while (lline >= lfile && stabs[lline].n_type != N_SOL && (stabs[lline].n_type != N_SO || !stabs[lline].n_value))
f0102783:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102786:	39 45 f4             	cmp    %eax,-0xc(%ebp)
f0102789:	7c 44                	jl     f01027cf <debuginfo_eip+0x250>
f010278b:	8b 55 f4             	mov    -0xc(%ebp),%edx
f010278e:	89 d0                	mov    %edx,%eax
f0102790:	01 c0                	add    %eax,%eax
f0102792:	01 d0                	add    %edx,%eax
f0102794:	c1 e0 02             	shl    $0x2,%eax
f0102797:	03 45 e4             	add    -0x1c(%ebp),%eax
f010279a:	0f b6 40 04          	movzbl 0x4(%eax),%eax
f010279e:	3c 84                	cmp    $0x84,%al
f01027a0:	74 2d                	je     f01027cf <debuginfo_eip+0x250>
f01027a2:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01027a5:	89 d0                	mov    %edx,%eax
f01027a7:	01 c0                	add    %eax,%eax
f01027a9:	01 d0                	add    %edx,%eax
f01027ab:	c1 e0 02             	shl    $0x2,%eax
f01027ae:	03 45 e4             	add    -0x1c(%ebp),%eax
f01027b1:	0f b6 40 04          	movzbl 0x4(%eax),%eax
f01027b5:	3c 64                	cmp    $0x64,%al
f01027b7:	75 c6                	jne    f010277f <debuginfo_eip+0x200>
f01027b9:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01027bc:	89 d0                	mov    %edx,%eax
f01027be:	01 c0                	add    %eax,%eax
f01027c0:	01 d0                	add    %edx,%eax
f01027c2:	c1 e0 02             	shl    $0x2,%eax
f01027c5:	03 45 e4             	add    -0x1c(%ebp),%eax
f01027c8:	8b 40 08             	mov    0x8(%eax),%eax
f01027cb:	85 c0                	test   %eax,%eax
f01027cd:	74 b0                	je     f010277f <debuginfo_eip+0x200>
		lline--;
	if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr)
f01027cf:	8b 45 e0             	mov    -0x20(%ebp),%eax
f01027d2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
f01027d5:	7c 3d                	jl     f0102814 <debuginfo_eip+0x295>
f01027d7:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01027da:	89 d0                	mov    %edx,%eax
f01027dc:	01 c0                	add    %eax,%eax
f01027de:	01 d0                	add    %edx,%eax
f01027e0:	c1 e0 02             	shl    $0x2,%eax
f01027e3:	03 45 e4             	add    -0x1c(%ebp),%eax
f01027e6:	8b 08                	mov    (%eax),%ecx
f01027e8:	8b 55 f0             	mov    -0x10(%ebp),%edx
f01027eb:	8b 45 ec             	mov    -0x14(%ebp),%eax
f01027ee:	89 d3                	mov    %edx,%ebx
f01027f0:	29 c3                	sub    %eax,%ebx
f01027f2:	89 d8                	mov    %ebx,%eax
f01027f4:	39 c1                	cmp    %eax,%ecx
f01027f6:	73 1c                	jae    f0102814 <debuginfo_eip+0x295>
		info->eip_file = stabstr + stabs[lline].n_strx;
f01027f8:	8b 55 f4             	mov    -0xc(%ebp),%edx
f01027fb:	89 d0                	mov    %edx,%eax
f01027fd:	01 c0                	add    %eax,%eax
f01027ff:	01 d0                	add    %edx,%eax
f0102801:	c1 e0 02             	shl    $0x2,%eax
f0102804:	03 45 e4             	add    -0x1c(%ebp),%eax
f0102807:	8b 00                	mov    (%eax),%eax
f0102809:	89 c2                	mov    %eax,%edx
f010280b:	03 55 ec             	add    -0x14(%ebp),%edx
f010280e:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102811:	89 50 0c             	mov    %edx,0xc(%eax)
	
	return 0;
f0102814:	c7 45 c8 00 00 00 00 	movl   $0x0,-0x38(%ebp)
f010281b:	8b 45 c8             	mov    -0x38(%ebp),%eax
}
f010281e:	83 c4 54             	add    $0x54,%esp
f0102821:	5b                   	pop    %ebx
f0102822:	5d                   	pop    %ebp
f0102823:	c3                   	ret    

f0102824 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
f0102824:	55                   	push   %ebp
f0102825:	89 e5                	mov    %esp,%ebp
f0102827:	53                   	push   %ebx
f0102828:	83 ec 34             	sub    $0x34,%esp
f010282b:	8b 45 10             	mov    0x10(%ebp),%eax
f010282e:	89 45 f0             	mov    %eax,-0x10(%ebp)
f0102831:	8b 45 14             	mov    0x14(%ebp),%eax
f0102834:	89 45 f4             	mov    %eax,-0xc(%ebp)
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
f0102837:	8b 45 18             	mov    0x18(%ebp),%eax
f010283a:	ba 00 00 00 00       	mov    $0x0,%edx
f010283f:	89 45 e8             	mov    %eax,-0x18(%ebp)
f0102842:	89 55 ec             	mov    %edx,-0x14(%ebp)
f0102845:	8b 55 ec             	mov    -0x14(%ebp),%edx
f0102848:	3b 55 f4             	cmp    -0xc(%ebp),%edx
f010284b:	77 7c                	ja     f01028c9 <printnum+0xa5>
f010284d:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102850:	3b 45 f4             	cmp    -0xc(%ebp),%eax
f0102853:	72 08                	jb     f010285d <printnum+0x39>
f0102855:	8b 55 e8             	mov    -0x18(%ebp),%edx
f0102858:	3b 55 f0             	cmp    -0x10(%ebp),%edx
f010285b:	77 6c                	ja     f01028c9 <printnum+0xa5>
		printnum(putch, putdat, num / base, base, width - 1, padc);
f010285d:	8b 45 1c             	mov    0x1c(%ebp),%eax
f0102860:	8d 58 ff             	lea    -0x1(%eax),%ebx
f0102863:	8b 45 18             	mov    0x18(%ebp),%eax
f0102866:	ba 00 00 00 00       	mov    $0x0,%edx
f010286b:	89 44 24 08          	mov    %eax,0x8(%esp)
f010286f:	89 54 24 0c          	mov    %edx,0xc(%esp)
f0102873:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0102876:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0102879:	89 04 24             	mov    %eax,(%esp)
f010287c:	89 54 24 04          	mov    %edx,0x4(%esp)
f0102880:	e8 fb 0c 00 00       	call   f0103580 <__udivdi3>
f0102885:	89 d1                	mov    %edx,%ecx
f0102887:	89 c2                	mov    %eax,%edx
f0102889:	8b 45 20             	mov    0x20(%ebp),%eax
f010288c:	89 44 24 18          	mov    %eax,0x18(%esp)
f0102890:	89 5c 24 14          	mov    %ebx,0x14(%esp)
f0102894:	8b 45 18             	mov    0x18(%ebp),%eax
f0102897:	89 44 24 10          	mov    %eax,0x10(%esp)
f010289b:	89 54 24 08          	mov    %edx,0x8(%esp)
f010289f:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
f01028a3:	8b 45 0c             	mov    0xc(%ebp),%eax
f01028a6:	89 44 24 04          	mov    %eax,0x4(%esp)
f01028aa:	8b 45 08             	mov    0x8(%ebp),%eax
f01028ad:	89 04 24             	mov    %eax,(%esp)
f01028b0:	e8 6f ff ff ff       	call   f0102824 <printnum>
f01028b5:	eb 1c                	jmp    f01028d3 <printnum+0xaf>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
f01028b7:	8b 45 0c             	mov    0xc(%ebp),%eax
f01028ba:	89 44 24 04          	mov    %eax,0x4(%esp)
f01028be:	8b 45 20             	mov    0x20(%ebp),%eax
f01028c1:	89 04 24             	mov    %eax,(%esp)
f01028c4:	8b 45 08             	mov    0x8(%ebp),%eax
f01028c7:	ff d0                	call   *%eax
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
		printnum(putch, putdat, num / base, base, width - 1, padc);
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
f01028c9:	83 6d 1c 01          	subl   $0x1,0x1c(%ebp)
f01028cd:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
f01028d1:	7f e4                	jg     f01028b7 <printnum+0x93>
			putch(padc, putdat);
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
f01028d3:	8b 45 18             	mov    0x18(%ebp),%eax
f01028d6:	ba 00 00 00 00       	mov    $0x0,%edx
f01028db:	8b 4d f0             	mov    -0x10(%ebp),%ecx
f01028de:	8b 5d f4             	mov    -0xc(%ebp),%ebx
f01028e1:	89 44 24 08          	mov    %eax,0x8(%esp)
f01028e5:	89 54 24 0c          	mov    %edx,0xc(%esp)
f01028e9:	89 0c 24             	mov    %ecx,(%esp)
f01028ec:	89 5c 24 04          	mov    %ebx,0x4(%esp)
f01028f0:	e8 cb 0d 00 00       	call   f01036c0 <__umoddi3>
f01028f5:	05 e0 40 10 f0       	add    $0xf01040e0,%eax
f01028fa:	0f b6 00             	movzbl (%eax),%eax
f01028fd:	0f be d0             	movsbl %al,%edx
f0102900:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102903:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102907:	89 14 24             	mov    %edx,(%esp)
f010290a:	8b 45 08             	mov    0x8(%ebp),%eax
f010290d:	ff d0                	call   *%eax
}
f010290f:	83 c4 34             	add    $0x34,%esp
f0102912:	5b                   	pop    %ebx
f0102913:	5d                   	pop    %ebp
f0102914:	c3                   	ret    

f0102915 <getuint>:

// Get an unsigned int of various possible sizes from a varargs list,
// depending on the lflag parameter.
static unsigned long long
getuint(va_list *ap, int lflag)
{
f0102915:	55                   	push   %ebp
f0102916:	89 e5                	mov    %esp,%ebp
f0102918:	83 ec 08             	sub    $0x8,%esp
	if (lflag >= 2)
f010291b:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
f010291f:	7e 22                	jle    f0102943 <getuint+0x2e>
		return va_arg(*ap, unsigned long long);
f0102921:	8b 45 08             	mov    0x8(%ebp),%eax
f0102924:	8b 00                	mov    (%eax),%eax
f0102926:	8d 50 08             	lea    0x8(%eax),%edx
f0102929:	8b 45 08             	mov    0x8(%ebp),%eax
f010292c:	89 10                	mov    %edx,(%eax)
f010292e:	8b 45 08             	mov    0x8(%ebp),%eax
f0102931:	8b 00                	mov    (%eax),%eax
f0102933:	83 e8 08             	sub    $0x8,%eax
f0102936:	8b 10                	mov    (%eax),%edx
f0102938:	8b 48 04             	mov    0x4(%eax),%ecx
f010293b:	89 55 f8             	mov    %edx,-0x8(%ebp)
f010293e:	89 4d fc             	mov    %ecx,-0x4(%ebp)
f0102941:	eb 4a                	jmp    f010298d <getuint+0x78>
	else if (lflag)
f0102943:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
f0102947:	74 23                	je     f010296c <getuint+0x57>
		return va_arg(*ap, unsigned long);
f0102949:	8b 45 08             	mov    0x8(%ebp),%eax
f010294c:	8b 00                	mov    (%eax),%eax
f010294e:	8d 50 04             	lea    0x4(%eax),%edx
f0102951:	8b 45 08             	mov    0x8(%ebp),%eax
f0102954:	89 10                	mov    %edx,(%eax)
f0102956:	8b 45 08             	mov    0x8(%ebp),%eax
f0102959:	8b 00                	mov    (%eax),%eax
f010295b:	83 e8 04             	sub    $0x4,%eax
f010295e:	8b 00                	mov    (%eax),%eax
f0102960:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0102963:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f010296a:	eb 21                	jmp    f010298d <getuint+0x78>
	else
		return va_arg(*ap, unsigned int);
f010296c:	8b 45 08             	mov    0x8(%ebp),%eax
f010296f:	8b 00                	mov    (%eax),%eax
f0102971:	8d 50 04             	lea    0x4(%eax),%edx
f0102974:	8b 45 08             	mov    0x8(%ebp),%eax
f0102977:	89 10                	mov    %edx,(%eax)
f0102979:	8b 45 08             	mov    0x8(%ebp),%eax
f010297c:	8b 00                	mov    (%eax),%eax
f010297e:	83 e8 04             	sub    $0x4,%eax
f0102981:	8b 00                	mov    (%eax),%eax
f0102983:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0102986:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f010298d:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0102990:	8b 55 fc             	mov    -0x4(%ebp),%edx
}
f0102993:	c9                   	leave  
f0102994:	c3                   	ret    

f0102995 <getint>:

// Same as getuint but signed - can't use getuint
// because of sign extension
static long long
getint(va_list *ap, int lflag)
{
f0102995:	55                   	push   %ebp
f0102996:	89 e5                	mov    %esp,%ebp
f0102998:	83 ec 08             	sub    $0x8,%esp
	if (lflag >= 2)
f010299b:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
f010299f:	7e 22                	jle    f01029c3 <getint+0x2e>
		return va_arg(*ap, long long);
f01029a1:	8b 45 08             	mov    0x8(%ebp),%eax
f01029a4:	8b 00                	mov    (%eax),%eax
f01029a6:	8d 50 08             	lea    0x8(%eax),%edx
f01029a9:	8b 45 08             	mov    0x8(%ebp),%eax
f01029ac:	89 10                	mov    %edx,(%eax)
f01029ae:	8b 45 08             	mov    0x8(%ebp),%eax
f01029b1:	8b 00                	mov    (%eax),%eax
f01029b3:	83 e8 08             	sub    $0x8,%eax
f01029b6:	8b 10                	mov    (%eax),%edx
f01029b8:	8b 48 04             	mov    0x4(%eax),%ecx
f01029bb:	89 55 f8             	mov    %edx,-0x8(%ebp)
f01029be:	89 4d fc             	mov    %ecx,-0x4(%ebp)
f01029c1:	eb 4c                	jmp    f0102a0f <getint+0x7a>
	else if (lflag)
f01029c3:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
f01029c7:	74 24                	je     f01029ed <getint+0x58>
		return va_arg(*ap, long);
f01029c9:	8b 45 08             	mov    0x8(%ebp),%eax
f01029cc:	8b 00                	mov    (%eax),%eax
f01029ce:	8d 50 04             	lea    0x4(%eax),%edx
f01029d1:	8b 45 08             	mov    0x8(%ebp),%eax
f01029d4:	89 10                	mov    %edx,(%eax)
f01029d6:	8b 45 08             	mov    0x8(%ebp),%eax
f01029d9:	8b 00                	mov    (%eax),%eax
f01029db:	83 e8 04             	sub    $0x4,%eax
f01029de:	8b 00                	mov    (%eax),%eax
f01029e0:	89 45 f8             	mov    %eax,-0x8(%ebp)
f01029e3:	89 c1                	mov    %eax,%ecx
f01029e5:	c1 f9 1f             	sar    $0x1f,%ecx
f01029e8:	89 4d fc             	mov    %ecx,-0x4(%ebp)
f01029eb:	eb 22                	jmp    f0102a0f <getint+0x7a>
	else
		return va_arg(*ap, int);
f01029ed:	8b 45 08             	mov    0x8(%ebp),%eax
f01029f0:	8b 00                	mov    (%eax),%eax
f01029f2:	8d 50 04             	lea    0x4(%eax),%edx
f01029f5:	8b 45 08             	mov    0x8(%ebp),%eax
f01029f8:	89 10                	mov    %edx,(%eax)
f01029fa:	8b 45 08             	mov    0x8(%ebp),%eax
f01029fd:	8b 00                	mov    (%eax),%eax
f01029ff:	83 e8 04             	sub    $0x4,%eax
f0102a02:	8b 00                	mov    (%eax),%eax
f0102a04:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0102a07:	89 c2                	mov    %eax,%edx
f0102a09:	c1 fa 1f             	sar    $0x1f,%edx
f0102a0c:	89 55 fc             	mov    %edx,-0x4(%ebp)
f0102a0f:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0102a12:	8b 55 fc             	mov    -0x4(%ebp),%edx
}
f0102a15:	c9                   	leave  
f0102a16:	c3                   	ret    

f0102a17 <vprintfmt>:
// Main function to format and print a string.
void printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...);

void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap)
{
f0102a17:	55                   	push   %ebp
f0102a18:	89 e5                	mov    %esp,%ebp
f0102a1a:	83 ec 58             	sub    $0x58,%esp
f0102a1d:	eb 1c                	jmp    f0102a3b <vprintfmt+0x24>
	int base, lflag, width, precision, altflag;
	char padc;

	while (1) {
		while ((ch = *(unsigned char *) fmt++) != '%') {
			if (ch == '\0')
f0102a1f:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
f0102a23:	0f 84 44 04 00 00    	je     f0102e6d <vprintfmt+0x456>
				return;
			putch(ch, putdat);
f0102a29:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102a2c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102a30:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0102a33:	89 04 24             	mov    %eax,(%esp)
f0102a36:	8b 45 08             	mov    0x8(%ebp),%eax
f0102a39:	ff d0                	call   *%eax
	unsigned long long num;
	int base, lflag, width, precision, altflag;
	char padc;

	while (1) {
		while ((ch = *(unsigned char *) fmt++) != '%') {
f0102a3b:	8b 45 10             	mov    0x10(%ebp),%eax
f0102a3e:	0f b6 00             	movzbl (%eax),%eax
f0102a41:	0f b6 c0             	movzbl %al,%eax
f0102a44:	89 45 d8             	mov    %eax,-0x28(%ebp)
f0102a47:	83 7d d8 25          	cmpl   $0x25,-0x28(%ebp)
f0102a4b:	0f 95 c0             	setne  %al
f0102a4e:	83 45 10 01          	addl   $0x1,0x10(%ebp)
f0102a52:	84 c0                	test   %al,%al
f0102a54:	75 c9                	jne    f0102a1f <vprintfmt+0x8>
				return;
			putch(ch, putdat);
		}

		// Process a %-escape sequence
		padc = ' ';
f0102a56:	c6 45 ff 20          	movb   $0x20,-0x1(%ebp)
		width = -1;
f0102a5a:	c7 45 f0 ff ff ff ff 	movl   $0xffffffff,-0x10(%ebp)
		precision = -1;
f0102a61:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,-0xc(%ebp)
		lflag = 0;
f0102a68:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
		altflag = 0;
f0102a6f:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
	reswitch:
		switch (ch = *(unsigned char *) fmt++) {
f0102a76:	8b 45 10             	mov    0x10(%ebp),%eax
f0102a79:	0f b6 00             	movzbl (%eax),%eax
f0102a7c:	0f b6 c0             	movzbl %al,%eax
f0102a7f:	89 45 d8             	mov    %eax,-0x28(%ebp)
f0102a82:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0102a85:	83 45 10 01          	addl   $0x1,0x10(%ebp)
f0102a89:	83 e8 23             	sub    $0x23,%eax
f0102a8c:	89 45 d0             	mov    %eax,-0x30(%ebp)
f0102a8f:	83 7d d0 55          	cmpl   $0x55,-0x30(%ebp)
f0102a93:	0f 87 86 03 00 00    	ja     f0102e1f <vprintfmt+0x408>
f0102a99:	8b 55 d0             	mov    -0x30(%ebp),%edx
f0102a9c:	8b 04 95 04 41 10 f0 	mov    -0xfefbefc(,%edx,4),%eax
f0102aa3:	ff e0                	jmp    *%eax

		// flag to pad on the right
		case '-':
			padc = '-';
f0102aa5:	c6 45 ff 2d          	movb   $0x2d,-0x1(%ebp)
f0102aa9:	eb cb                	jmp    f0102a76 <vprintfmt+0x5f>
			goto reswitch;
			
		// flag to pad with 0's instead of spaces
		case '0':
			padc = '0';
f0102aab:	c6 45 ff 30          	movb   $0x30,-0x1(%ebp)
f0102aaf:	eb c5                	jmp    f0102a76 <vprintfmt+0x5f>
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			for (precision = 0; ; ++fmt) {
f0102ab1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
				precision = precision * 10 + ch - '0';
f0102ab8:	8b 55 f4             	mov    -0xc(%ebp),%edx
f0102abb:	89 d0                	mov    %edx,%eax
f0102abd:	c1 e0 02             	shl    $0x2,%eax
f0102ac0:	01 d0                	add    %edx,%eax
f0102ac2:	01 c0                	add    %eax,%eax
f0102ac4:	03 45 d8             	add    -0x28(%ebp),%eax
f0102ac7:	83 e8 30             	sub    $0x30,%eax
f0102aca:	89 45 f4             	mov    %eax,-0xc(%ebp)
				ch = *fmt;
f0102acd:	8b 45 10             	mov    0x10(%ebp),%eax
f0102ad0:	0f b6 00             	movzbl (%eax),%eax
f0102ad3:	0f be c0             	movsbl %al,%eax
f0102ad6:	89 45 d8             	mov    %eax,-0x28(%ebp)
				if (ch < '0' || ch > '9')
f0102ad9:	83 7d d8 2f          	cmpl   $0x2f,-0x28(%ebp)
f0102add:	7e 44                	jle    f0102b23 <vprintfmt+0x10c>
f0102adf:	83 7d d8 39          	cmpl   $0x39,-0x28(%ebp)
f0102ae3:	7f 3e                	jg     f0102b23 <vprintfmt+0x10c>
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			for (precision = 0; ; ++fmt) {
f0102ae5:	83 45 10 01          	addl   $0x1,0x10(%ebp)
f0102ae9:	eb cd                	jmp    f0102ab8 <vprintfmt+0xa1>
					break;
			}
			goto process_precision;

		case '*':
			precision = va_arg(ap, int);
f0102aeb:	8b 45 14             	mov    0x14(%ebp),%eax
f0102aee:	83 c0 04             	add    $0x4,%eax
f0102af1:	89 45 14             	mov    %eax,0x14(%ebp)
f0102af4:	8b 45 14             	mov    0x14(%ebp),%eax
f0102af7:	83 e8 04             	sub    $0x4,%eax
f0102afa:	8b 00                	mov    (%eax),%eax
f0102afc:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0102aff:	eb 22                	jmp    f0102b23 <vprintfmt+0x10c>
			goto process_precision;

		case '.':
			if (width < 0)
f0102b01:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
f0102b05:	0f 89 6b ff ff ff    	jns    f0102a76 <vprintfmt+0x5f>
				width = 0;
f0102b0b:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
f0102b12:	e9 5f ff ff ff       	jmp    f0102a76 <vprintfmt+0x5f>
			goto reswitch;

		case '#':
			altflag = 1;
f0102b17:	c7 45 f8 01 00 00 00 	movl   $0x1,-0x8(%ebp)
f0102b1e:	e9 53 ff ff ff       	jmp    f0102a76 <vprintfmt+0x5f>
			goto reswitch;

		process_precision:
			if (width < 0)
f0102b23:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
f0102b27:	0f 89 49 ff ff ff    	jns    f0102a76 <vprintfmt+0x5f>
				width = precision, precision = -1;
f0102b2d:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102b30:	89 45 f0             	mov    %eax,-0x10(%ebp)
f0102b33:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,-0xc(%ebp)
f0102b3a:	e9 37 ff ff ff       	jmp    f0102a76 <vprintfmt+0x5f>
			goto reswitch;

		// long flag (doubled for long long)
		case 'l':
			lflag++;
f0102b3f:	83 45 ec 01          	addl   $0x1,-0x14(%ebp)
f0102b43:	e9 2e ff ff ff       	jmp    f0102a76 <vprintfmt+0x5f>
			goto reswitch;

		// character
		case 'c':
			putch(va_arg(ap, int), putdat);
f0102b48:	8b 45 14             	mov    0x14(%ebp),%eax
f0102b4b:	83 c0 04             	add    $0x4,%eax
f0102b4e:	89 45 14             	mov    %eax,0x14(%ebp)
f0102b51:	8b 45 14             	mov    0x14(%ebp),%eax
f0102b54:	83 e8 04             	sub    $0x4,%eax
f0102b57:	8b 10                	mov    (%eax),%edx
f0102b59:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102b5c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102b60:	89 14 24             	mov    %edx,(%esp)
f0102b63:	8b 45 08             	mov    0x8(%ebp),%eax
f0102b66:	ff d0                	call   *%eax
f0102b68:	e9 ce fe ff ff       	jmp    f0102a3b <vprintfmt+0x24>
			break;

		// error message
		case 'e':
			err = va_arg(ap, int);
f0102b6d:	8b 45 14             	mov    0x14(%ebp),%eax
f0102b70:	83 c0 04             	add    $0x4,%eax
f0102b73:	89 45 14             	mov    %eax,0x14(%ebp)
f0102b76:	8b 45 14             	mov    0x14(%ebp),%eax
f0102b79:	83 e8 04             	sub    $0x4,%eax
f0102b7c:	8b 00                	mov    (%eax),%eax
f0102b7e:	89 45 dc             	mov    %eax,-0x24(%ebp)
			if (err < 0)
f0102b81:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
f0102b85:	79 03                	jns    f0102b8a <vprintfmt+0x173>
				err = -err;
f0102b87:	f7 5d dc             	negl   -0x24(%ebp)
			if (err > MAXERROR || (p = error_string[err]) == NULL)
f0102b8a:	83 7d dc 07          	cmpl   $0x7,-0x24(%ebp)
f0102b8e:	7f 13                	jg     f0102ba3 <vprintfmt+0x18c>
f0102b90:	8b 45 dc             	mov    -0x24(%ebp),%eax
f0102b93:	8b 04 85 c0 40 10 f0 	mov    -0xfefbf40(,%eax,4),%eax
f0102b9a:	89 45 d4             	mov    %eax,-0x2c(%ebp)
f0102b9d:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
f0102ba1:	75 26                	jne    f0102bc9 <vprintfmt+0x1b2>
				printfmt(putch, putdat, "error %d", err);
f0102ba3:	8b 45 dc             	mov    -0x24(%ebp),%eax
f0102ba6:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0102baa:	c7 44 24 08 f1 40 10 	movl   $0xf01040f1,0x8(%esp)
f0102bb1:	f0 
f0102bb2:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102bb5:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102bb9:	8b 45 08             	mov    0x8(%ebp),%eax
f0102bbc:	89 04 24             	mov    %eax,(%esp)
f0102bbf:	e8 ab 02 00 00       	call   f0102e6f <printfmt>
f0102bc4:	e9 72 fe ff ff       	jmp    f0102a3b <vprintfmt+0x24>
			else
				printfmt(putch, putdat, "%s", p);
f0102bc9:	8b 55 d4             	mov    -0x2c(%ebp),%edx
f0102bcc:	89 54 24 0c          	mov    %edx,0xc(%esp)
f0102bd0:	c7 44 24 08 fa 40 10 	movl   $0xf01040fa,0x8(%esp)
f0102bd7:	f0 
f0102bd8:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102bdb:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102bdf:	8b 45 08             	mov    0x8(%ebp),%eax
f0102be2:	89 04 24             	mov    %eax,(%esp)
f0102be5:	e8 85 02 00 00       	call   f0102e6f <printfmt>
f0102bea:	e9 4c fe ff ff       	jmp    f0102a3b <vprintfmt+0x24>
			break;

		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL)
f0102bef:	8b 45 14             	mov    0x14(%ebp),%eax
f0102bf2:	83 c0 04             	add    $0x4,%eax
f0102bf5:	89 45 14             	mov    %eax,0x14(%ebp)
f0102bf8:	8b 45 14             	mov    0x14(%ebp),%eax
f0102bfb:	83 e8 04             	sub    $0x4,%eax
f0102bfe:	8b 00                	mov    (%eax),%eax
f0102c00:	89 45 d4             	mov    %eax,-0x2c(%ebp)
f0102c03:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
f0102c07:	75 07                	jne    f0102c10 <vprintfmt+0x1f9>
				p = "(null)";
f0102c09:	c7 45 d4 fd 40 10 f0 	movl   $0xf01040fd,-0x2c(%ebp)
			if (width > 0 && padc != '-')
f0102c10:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
f0102c14:	7e 79                	jle    f0102c8f <vprintfmt+0x278>
f0102c16:	80 7d ff 2d          	cmpb   $0x2d,-0x1(%ebp)
f0102c1a:	74 73                	je     f0102c8f <vprintfmt+0x278>
				for (width -= strnlen(p, precision); width > 0; width--)
f0102c1c:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102c1f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102c23:	8b 45 d4             	mov    -0x2c(%ebp),%eax
f0102c26:	89 04 24             	mov    %eax,(%esp)
f0102c29:	e8 64 04 00 00       	call   f0103092 <strnlen>
f0102c2e:	29 45 f0             	sub    %eax,-0x10(%ebp)
f0102c31:	eb 17                	jmp    f0102c4a <vprintfmt+0x233>
					putch(padc, putdat);
f0102c33:	0f be 45 ff          	movsbl -0x1(%ebp),%eax
f0102c37:	8b 55 0c             	mov    0xc(%ebp),%edx
f0102c3a:	89 54 24 04          	mov    %edx,0x4(%esp)
f0102c3e:	89 04 24             	mov    %eax,(%esp)
f0102c41:	8b 45 08             	mov    0x8(%ebp),%eax
f0102c44:	ff d0                	call   *%eax
		// string
		case 's':
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
f0102c46:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
f0102c4a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
f0102c4e:	7f e3                	jg     f0102c33 <vprintfmt+0x21c>
f0102c50:	eb 3d                	jmp    f0102c8f <vprintfmt+0x278>
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
				if (altflag && (ch < ' ' || ch > '~'))
f0102c52:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
f0102c56:	74 21                	je     f0102c79 <vprintfmt+0x262>
f0102c58:	83 7d d8 1f          	cmpl   $0x1f,-0x28(%ebp)
f0102c5c:	7e 06                	jle    f0102c64 <vprintfmt+0x24d>
f0102c5e:	83 7d d8 7e          	cmpl   $0x7e,-0x28(%ebp)
f0102c62:	7e 15                	jle    f0102c79 <vprintfmt+0x262>
					putch('?', putdat);
f0102c64:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102c67:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102c6b:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
f0102c72:	8b 45 08             	mov    0x8(%ebp),%eax
f0102c75:	ff d0                	call   *%eax
f0102c77:	eb 12                	jmp    f0102c8b <vprintfmt+0x274>
				else
					putch(ch, putdat);
f0102c79:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102c7c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102c80:	8b 55 d8             	mov    -0x28(%ebp),%edx
f0102c83:	89 14 24             	mov    %edx,(%esp)
f0102c86:	8b 45 08             	mov    0x8(%ebp),%eax
f0102c89:	ff d0                	call   *%eax
			if ((p = va_arg(ap, char *)) == NULL)
				p = "(null)";
			if (width > 0 && padc != '-')
				for (width -= strnlen(p, precision); width > 0; width--)
					putch(padc, putdat);
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
f0102c8b:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
f0102c8f:	8b 55 d4             	mov    -0x2c(%ebp),%edx
f0102c92:	0f b6 02             	movzbl (%edx),%eax
f0102c95:	0f be c0             	movsbl %al,%eax
f0102c98:	89 45 d8             	mov    %eax,-0x28(%ebp)
f0102c9b:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
f0102c9f:	0f 95 c0             	setne  %al
f0102ca2:	83 45 d4 01          	addl   $0x1,-0x2c(%ebp)
f0102ca6:	83 f0 01             	xor    $0x1,%eax
f0102ca9:	84 c0                	test   %al,%al
f0102cab:	75 29                	jne    f0102cd6 <vprintfmt+0x2bf>
f0102cad:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
f0102cb1:	78 9f                	js     f0102c52 <vprintfmt+0x23b>
f0102cb3:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
f0102cb7:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
f0102cbb:	79 95                	jns    f0102c52 <vprintfmt+0x23b>
f0102cbd:	eb 17                	jmp    f0102cd6 <vprintfmt+0x2bf>
				if (altflag && (ch < ' ' || ch > '~'))
					putch('?', putdat);
				else
					putch(ch, putdat);
			for (; width > 0; width--)
				putch(' ', putdat);
f0102cbf:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102cc2:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102cc6:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
f0102ccd:	8b 45 08             	mov    0x8(%ebp),%eax
f0102cd0:	ff d0                	call   *%eax
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
				if (altflag && (ch < ' ' || ch > '~'))
					putch('?', putdat);
				else
					putch(ch, putdat);
			for (; width > 0; width--)
f0102cd2:	83 6d f0 01          	subl   $0x1,-0x10(%ebp)
f0102cd6:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
f0102cda:	7f e3                	jg     f0102cbf <vprintfmt+0x2a8>
f0102cdc:	e9 5a fd ff ff       	jmp    f0102a3b <vprintfmt+0x24>
				putch(' ', putdat);
			break;

		// (signed) decimal
		case 'd':
			num = getint(&ap, lflag);
f0102ce1:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102ce4:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102ce8:	8d 45 14             	lea    0x14(%ebp),%eax
f0102ceb:	89 04 24             	mov    %eax,(%esp)
f0102cee:	e8 a2 fc ff ff       	call   f0102995 <getint>
f0102cf3:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102cf6:	89 55 e4             	mov    %edx,-0x1c(%ebp)
			if ((long long) num < 0) {
f0102cf9:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102cfc:	8b 55 e4             	mov    -0x1c(%ebp),%edx
f0102cff:	85 d2                	test   %edx,%edx
f0102d01:	79 26                	jns    f0102d29 <vprintfmt+0x312>
				putch('-', putdat);
f0102d03:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102d06:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102d0a:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
f0102d11:	8b 45 08             	mov    0x8(%ebp),%eax
f0102d14:	ff d0                	call   *%eax
				num = -(long long) num;
f0102d16:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102d19:	8b 55 e4             	mov    -0x1c(%ebp),%edx
f0102d1c:	f7 d8                	neg    %eax
f0102d1e:	83 d2 00             	adc    $0x0,%edx
f0102d21:	f7 da                	neg    %edx
f0102d23:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102d26:	89 55 e4             	mov    %edx,-0x1c(%ebp)
			}
			base = 10;
f0102d29:	c7 45 e8 0a 00 00 00 	movl   $0xa,-0x18(%ebp)
f0102d30:	e9 af 00 00 00       	jmp    f0102de4 <vprintfmt+0x3cd>
			goto number;

		// unsigned decimal
		case 'u':
			num = getuint(&ap, lflag);
f0102d35:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102d38:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102d3c:	8d 45 14             	lea    0x14(%ebp),%eax
f0102d3f:	89 04 24             	mov    %eax,(%esp)
f0102d42:	e8 ce fb ff ff       	call   f0102915 <getuint>
f0102d47:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102d4a:	89 55 e4             	mov    %edx,-0x1c(%ebp)
			base = 10;
f0102d4d:	c7 45 e8 0a 00 00 00 	movl   $0xa,-0x18(%ebp)
f0102d54:	e9 8b 00 00 00       	jmp    f0102de4 <vprintfmt+0x3cd>
			goto number;

		// (unsigned) octal
		case 'o':
			// Replace this with your code.
			num = getuint(&ap, lflag);
f0102d59:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102d5c:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102d60:	8d 45 14             	lea    0x14(%ebp),%eax
f0102d63:	89 04 24             	mov    %eax,(%esp)
f0102d66:	e8 aa fb ff ff       	call   f0102915 <getuint>
f0102d6b:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102d6e:	89 55 e4             	mov    %edx,-0x1c(%ebp)
			base = 8;
f0102d71:	c7 45 e8 08 00 00 00 	movl   $0x8,-0x18(%ebp)
f0102d78:	eb 6a                	jmp    f0102de4 <vprintfmt+0x3cd>
			goto number;

		// pointer
		case 'p':
			putch('0', putdat);
f0102d7a:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102d7d:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102d81:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
f0102d88:	8b 45 08             	mov    0x8(%ebp),%eax
f0102d8b:	ff d0                	call   *%eax
			putch('x', putdat);
f0102d8d:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102d90:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102d94:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
f0102d9b:	8b 45 08             	mov    0x8(%ebp),%eax
f0102d9e:	ff d0                	call   *%eax
			num = (unsigned long long)
f0102da0:	8b 45 14             	mov    0x14(%ebp),%eax
f0102da3:	83 c0 04             	add    $0x4,%eax
f0102da6:	89 45 14             	mov    %eax,0x14(%ebp)
f0102da9:	8b 45 14             	mov    0x14(%ebp),%eax
f0102dac:	83 e8 04             	sub    $0x4,%eax
f0102daf:	8b 00                	mov    (%eax),%eax
f0102db1:	ba 00 00 00 00       	mov    $0x0,%edx
f0102db6:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102db9:	89 55 e4             	mov    %edx,-0x1c(%ebp)
				(uintptr_t) va_arg(ap, void *);
			base = 16;
f0102dbc:	c7 45 e8 10 00 00 00 	movl   $0x10,-0x18(%ebp)
f0102dc3:	eb 1f                	jmp    f0102de4 <vprintfmt+0x3cd>
			goto number;

		// (unsigned) hexadecimal
		case 'x':
			num = getuint(&ap, lflag);
f0102dc5:	8b 45 ec             	mov    -0x14(%ebp),%eax
f0102dc8:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102dcc:	8d 45 14             	lea    0x14(%ebp),%eax
f0102dcf:	89 04 24             	mov    %eax,(%esp)
f0102dd2:	e8 3e fb ff ff       	call   f0102915 <getuint>
f0102dd7:	89 45 e0             	mov    %eax,-0x20(%ebp)
f0102dda:	89 55 e4             	mov    %edx,-0x1c(%ebp)
			base = 16;
f0102ddd:	c7 45 e8 10 00 00 00 	movl   $0x10,-0x18(%ebp)
		number:
			printnum(putch, putdat, num, base, width, padc);
f0102de4:	0f be 45 ff          	movsbl -0x1(%ebp),%eax
f0102de8:	8b 55 e8             	mov    -0x18(%ebp),%edx
f0102deb:	89 44 24 18          	mov    %eax,0x18(%esp)
f0102def:	8b 45 f0             	mov    -0x10(%ebp),%eax
f0102df2:	89 44 24 14          	mov    %eax,0x14(%esp)
f0102df6:	89 54 24 10          	mov    %edx,0x10(%esp)
f0102dfa:	8b 45 e0             	mov    -0x20(%ebp),%eax
f0102dfd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
f0102e00:	89 44 24 08          	mov    %eax,0x8(%esp)
f0102e04:	89 54 24 0c          	mov    %edx,0xc(%esp)
f0102e08:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102e0b:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102e0f:	8b 45 08             	mov    0x8(%ebp),%eax
f0102e12:	89 04 24             	mov    %eax,(%esp)
f0102e15:	e8 0a fa ff ff       	call   f0102824 <printnum>
f0102e1a:	e9 1c fc ff ff       	jmp    f0102a3b <vprintfmt+0x24>
			break;

		// unrecognized escape sequence - just print it literally
		default:
			putch('%', putdat);
f0102e1f:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102e22:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102e26:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
f0102e2d:	8b 45 08             	mov    0x8(%ebp),%eax
f0102e30:	ff d0                	call   *%eax
f0102e32:	eb 13                	jmp    f0102e47 <vprintfmt+0x430>
			while (lflag-- > 0)
				putch('l', putdat);
f0102e34:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102e37:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102e3b:	c7 04 24 6c 00 00 00 	movl   $0x6c,(%esp)
f0102e42:	8b 45 08             	mov    0x8(%ebp),%eax
f0102e45:	ff d0                	call   *%eax
			break;

		// unrecognized escape sequence - just print it literally
		default:
			putch('%', putdat);
			while (lflag-- > 0)
f0102e47:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
f0102e4b:	0f 9f c0             	setg   %al
f0102e4e:	83 6d ec 01          	subl   $0x1,-0x14(%ebp)
f0102e52:	84 c0                	test   %al,%al
f0102e54:	75 de                	jne    f0102e34 <vprintfmt+0x41d>
				putch('l', putdat);
			/* FALLTHROUGH */

		// escaped '%' character
		case '%':
			putch(ch, putdat);
f0102e56:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102e59:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102e5d:	8b 45 d8             	mov    -0x28(%ebp),%eax
f0102e60:	89 04 24             	mov    %eax,(%esp)
f0102e63:	8b 45 08             	mov    0x8(%ebp),%eax
f0102e66:	ff d0                	call   *%eax
f0102e68:	e9 ce fb ff ff       	jmp    f0102a3b <vprintfmt+0x24>
		}
	}
}
f0102e6d:	c9                   	leave  
f0102e6e:	c3                   	ret    

f0102e6f <printfmt>:

void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...)
{
f0102e6f:	55                   	push   %ebp
f0102e70:	89 e5                	mov    %esp,%ebp
f0102e72:	83 ec 28             	sub    $0x28,%esp
	va_list ap;

	va_start(ap, fmt);
f0102e75:	8d 45 10             	lea    0x10(%ebp),%eax
f0102e78:	83 c0 04             	add    $0x4,%eax
f0102e7b:	89 45 fc             	mov    %eax,-0x4(%ebp)
	vprintfmt(putch, putdat, fmt, ap);
f0102e7e:	8b 55 10             	mov    0x10(%ebp),%edx
f0102e81:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0102e84:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0102e88:	89 54 24 08          	mov    %edx,0x8(%esp)
f0102e8c:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102e8f:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102e93:	8b 45 08             	mov    0x8(%ebp),%eax
f0102e96:	89 04 24             	mov    %eax,(%esp)
f0102e99:	e8 79 fb ff ff       	call   f0102a17 <vprintfmt>
	va_end(ap);
}
f0102e9e:	c9                   	leave  
f0102e9f:	c3                   	ret    

f0102ea0 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
f0102ea0:	55                   	push   %ebp
f0102ea1:	89 e5                	mov    %esp,%ebp
	b->cnt++;
f0102ea3:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102ea6:	8b 40 08             	mov    0x8(%eax),%eax
f0102ea9:	8d 50 01             	lea    0x1(%eax),%edx
f0102eac:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102eaf:	89 50 08             	mov    %edx,0x8(%eax)
	if (b->buf < b->ebuf)
f0102eb2:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102eb5:	8b 10                	mov    (%eax),%edx
f0102eb7:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102eba:	8b 40 04             	mov    0x4(%eax),%eax
f0102ebd:	39 c2                	cmp    %eax,%edx
f0102ebf:	73 12                	jae    f0102ed3 <sprintputch+0x33>
		*b->buf++ = ch;
f0102ec1:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102ec4:	8b 10                	mov    (%eax),%edx
f0102ec6:	8b 45 08             	mov    0x8(%ebp),%eax
f0102ec9:	88 02                	mov    %al,(%edx)
f0102ecb:	83 c2 01             	add    $0x1,%edx
f0102ece:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102ed1:	89 10                	mov    %edx,(%eax)
}
f0102ed3:	5d                   	pop    %ebp
f0102ed4:	c3                   	ret    

f0102ed5 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
f0102ed5:	55                   	push   %ebp
f0102ed6:	89 e5                	mov    %esp,%ebp
f0102ed8:	83 ec 28             	sub    $0x28,%esp
	struct sprintbuf b = {buf, buf+n-1, 0};
f0102edb:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102ede:	83 e8 01             	sub    $0x1,%eax
f0102ee1:	89 c2                	mov    %eax,%edx
f0102ee3:	03 55 08             	add    0x8(%ebp),%edx
f0102ee6:	8b 45 08             	mov    0x8(%ebp),%eax
f0102ee9:	89 45 f4             	mov    %eax,-0xc(%ebp)
f0102eec:	89 55 f8             	mov    %edx,-0x8(%ebp)
f0102eef:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)

	if (buf == NULL || n < 1)
f0102ef6:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
f0102efa:	74 06                	je     f0102f02 <vsnprintf+0x2d>
f0102efc:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
f0102f00:	7f 09                	jg     f0102f0b <vsnprintf+0x36>
		return -E_INVAL;
f0102f02:	c7 45 ec fd ff ff ff 	movl   $0xfffffffd,-0x14(%ebp)
f0102f09:	eb 2e                	jmp    f0102f39 <vsnprintf+0x64>

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
f0102f0b:	ba a0 2e 10 f0       	mov    $0xf0102ea0,%edx
f0102f10:	8b 45 14             	mov    0x14(%ebp),%eax
f0102f13:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0102f17:	8b 45 10             	mov    0x10(%ebp),%eax
f0102f1a:	89 44 24 08          	mov    %eax,0x8(%esp)
f0102f1e:	8d 45 f4             	lea    -0xc(%ebp),%eax
f0102f21:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102f25:	89 14 24             	mov    %edx,(%esp)
f0102f28:	e8 ea fa ff ff       	call   f0102a17 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
f0102f2d:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102f30:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
f0102f33:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0102f36:	89 45 ec             	mov    %eax,-0x14(%ebp)
f0102f39:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f0102f3c:	c9                   	leave  
f0102f3d:	c3                   	ret    

f0102f3e <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
f0102f3e:	55                   	push   %ebp
f0102f3f:	89 e5                	mov    %esp,%ebp
f0102f41:	83 ec 28             	sub    $0x28,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
f0102f44:	8d 45 10             	lea    0x10(%ebp),%eax
f0102f47:	83 c0 04             	add    $0x4,%eax
f0102f4a:	89 45 f8             	mov    %eax,-0x8(%ebp)
	rc = vsnprintf(buf, n, fmt, ap);
f0102f4d:	8b 55 10             	mov    0x10(%ebp),%edx
f0102f50:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0102f53:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0102f57:	89 54 24 08          	mov    %edx,0x8(%esp)
f0102f5b:	8b 45 0c             	mov    0xc(%ebp),%eax
f0102f5e:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102f62:	8b 45 08             	mov    0x8(%ebp),%eax
f0102f65:	89 04 24             	mov    %eax,(%esp)
f0102f68:	e8 68 ff ff ff       	call   f0102ed5 <vsnprintf>
f0102f6d:	89 45 fc             	mov    %eax,-0x4(%ebp)
	va_end(ap);

	return rc;
f0102f70:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0102f73:	c9                   	leave  
f0102f74:	c3                   	ret    
f0102f75:	00 00                	add    %al,(%eax)
	...

f0102f78 <readline>:
#define BUFLEN 1024
static char buf[BUFLEN];

char *
readline(const char *prompt)
{
f0102f78:	55                   	push   %ebp
f0102f79:	89 e5                	mov    %esp,%ebp
f0102f7b:	83 ec 28             	sub    $0x28,%esp
	int i, c, echoing;

	if (prompt != NULL)
f0102f7e:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
f0102f82:	74 13                	je     f0102f97 <readline+0x1f>
		cprintf("%s", prompt);
f0102f84:	8b 45 08             	mov    0x8(%ebp),%eax
f0102f87:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102f8b:	c7 04 24 5c 42 10 f0 	movl   $0xf010425c,(%esp)
f0102f92:	e8 d0 f4 ff ff       	call   f0102467 <cprintf>

	i = 0;
f0102f97:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	echoing = iscons(0);
f0102f9e:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
f0102fa5:	e8 ca d9 ff ff       	call   f0100974 <iscons>
f0102faa:	89 45 fc             	mov    %eax,-0x4(%ebp)
	while (1) {
		c = getchar();
f0102fad:	e8 a9 d9 ff ff       	call   f010095b <getchar>
f0102fb2:	89 45 f8             	mov    %eax,-0x8(%ebp)
		if (c < 0) {
f0102fb5:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
f0102fb9:	79 1f                	jns    f0102fda <readline+0x62>
			cprintf("read error: %e\n", c);
f0102fbb:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0102fbe:	89 44 24 04          	mov    %eax,0x4(%esp)
f0102fc2:	c7 04 24 5f 42 10 f0 	movl   $0xf010425f,(%esp)
f0102fc9:	e8 99 f4 ff ff       	call   f0102467 <cprintf>
			return NULL;
f0102fce:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
f0102fd5:	e9 8a 00 00 00       	jmp    f0103064 <readline+0xec>
		} else if (c >= ' ' && i < BUFLEN-1) {
f0102fda:	83 7d f8 1f          	cmpl   $0x1f,-0x8(%ebp)
f0102fde:	7e 2c                	jle    f010300c <readline+0x94>
f0102fe0:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
f0102fe7:	7f 23                	jg     f010300c <readline+0x94>
			if (echoing)
f0102fe9:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f0102fed:	74 0b                	je     f0102ffa <readline+0x82>
				cputchar(c);
f0102fef:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0102ff2:	89 04 24             	mov    %eax,(%esp)
f0102ff5:	e8 4e d9 ff ff       	call   f0100948 <cputchar>
			buf[i++] = c;
f0102ffa:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0102ffd:	8b 55 f8             	mov    -0x8(%ebp),%edx
f0103000:	88 90 20 38 11 f0    	mov    %dl,-0xfeec7e0(%eax)
f0103006:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
f010300a:	eb a1                	jmp    f0102fad <readline+0x35>
		} else if (c == '\b' && i > 0) {
f010300c:	83 7d f8 08          	cmpl   $0x8,-0x8(%ebp)
f0103010:	75 20                	jne    f0103032 <readline+0xba>
f0103012:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
f0103016:	7e 1a                	jle    f0103032 <readline+0xba>
			if (echoing)
f0103018:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f010301c:	74 0b                	je     f0103029 <readline+0xb1>
				cputchar(c);
f010301e:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0103021:	89 04 24             	mov    %eax,(%esp)
f0103024:	e8 1f d9 ff ff       	call   f0100948 <cputchar>
			i--;
f0103029:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
f010302d:	e9 7b ff ff ff       	jmp    f0102fad <readline+0x35>
		} else if (c == '\n' || c == '\r') {
f0103032:	83 7d f8 0a          	cmpl   $0xa,-0x8(%ebp)
f0103036:	74 0a                	je     f0103042 <readline+0xca>
f0103038:	83 7d f8 0d          	cmpl   $0xd,-0x8(%ebp)
f010303c:	0f 85 6b ff ff ff    	jne    f0102fad <readline+0x35>
			if (echoing)
f0103042:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f0103046:	74 0b                	je     f0103053 <readline+0xdb>
				cputchar(c);
f0103048:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010304b:	89 04 24             	mov    %eax,(%esp)
f010304e:	e8 f5 d8 ff ff       	call   f0100948 <cputchar>
			buf[i] = 0;
f0103053:	8b 45 f4             	mov    -0xc(%ebp),%eax
f0103056:	c6 80 20 38 11 f0 00 	movb   $0x0,-0xfeec7e0(%eax)
			return buf;
f010305d:	c7 45 ec 20 38 11 f0 	movl   $0xf0113820,-0x14(%ebp)
		}
	}
f0103064:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f0103067:	c9                   	leave  
f0103068:	c3                   	ret    
f0103069:	00 00                	add    %al,(%eax)
	...

f010306c <strlen>:

#include <inc/string.h>

int
strlen(const char *s)
{
f010306c:	55                   	push   %ebp
f010306d:	89 e5                	mov    %esp,%ebp
f010306f:	83 ec 10             	sub    $0x10,%esp
	int n;

	for (n = 0; *s != '\0'; s++)
f0103072:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f0103079:	eb 08                	jmp    f0103083 <strlen+0x17>
		n++;
f010307b:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
int
strlen(const char *s)
{
	int n;

	for (n = 0; *s != '\0'; s++)
f010307f:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f0103083:	8b 45 08             	mov    0x8(%ebp),%eax
f0103086:	0f b6 00             	movzbl (%eax),%eax
f0103089:	84 c0                	test   %al,%al
f010308b:	75 ee                	jne    f010307b <strlen+0xf>
		n++;
	return n;
f010308d:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0103090:	c9                   	leave  
f0103091:	c3                   	ret    

f0103092 <strnlen>:

int
strnlen(const char *s, size_t size)
{
f0103092:	55                   	push   %ebp
f0103093:	89 e5                	mov    %esp,%ebp
f0103095:	83 ec 10             	sub    $0x10,%esp
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
f0103098:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f010309f:	eb 0c                	jmp    f01030ad <strnlen+0x1b>
		n++;
f01030a1:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
int
strnlen(const char *s, size_t size)
{
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
f01030a5:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f01030a9:	83 6d 0c 01          	subl   $0x1,0xc(%ebp)
f01030ad:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
f01030b1:	74 0a                	je     f01030bd <strnlen+0x2b>
f01030b3:	8b 45 08             	mov    0x8(%ebp),%eax
f01030b6:	0f b6 00             	movzbl (%eax),%eax
f01030b9:	84 c0                	test   %al,%al
f01030bb:	75 e4                	jne    f01030a1 <strnlen+0xf>
		n++;
	return n;
f01030bd:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f01030c0:	c9                   	leave  
f01030c1:	c3                   	ret    

f01030c2 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
f01030c2:	55                   	push   %ebp
f01030c3:	89 e5                	mov    %esp,%ebp
f01030c5:	83 ec 10             	sub    $0x10,%esp
	char *ret;

	ret = dst;
f01030c8:	8b 45 08             	mov    0x8(%ebp),%eax
f01030cb:	89 45 fc             	mov    %eax,-0x4(%ebp)
	while ((*dst++ = *src++) != '\0')
f01030ce:	8b 45 0c             	mov    0xc(%ebp),%eax
f01030d1:	0f b6 10             	movzbl (%eax),%edx
f01030d4:	8b 45 08             	mov    0x8(%ebp),%eax
f01030d7:	88 10                	mov    %dl,(%eax)
f01030d9:	8b 45 08             	mov    0x8(%ebp),%eax
f01030dc:	0f b6 00             	movzbl (%eax),%eax
f01030df:	84 c0                	test   %al,%al
f01030e1:	0f 95 c0             	setne  %al
f01030e4:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f01030e8:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
f01030ec:	84 c0                	test   %al,%al
f01030ee:	75 de                	jne    f01030ce <strcpy+0xc>
		/* do nothing */;
	return ret;
f01030f0:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f01030f3:	c9                   	leave  
f01030f4:	c3                   	ret    

f01030f5 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
f01030f5:	55                   	push   %ebp
f01030f6:	89 e5                	mov    %esp,%ebp
f01030f8:	83 ec 10             	sub    $0x10,%esp
	size_t i;
	char *ret;

	ret = dst;
f01030fb:	8b 45 08             	mov    0x8(%ebp),%eax
f01030fe:	89 45 fc             	mov    %eax,-0x4(%ebp)
	for (i = 0; i < size; i++) {
f0103101:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
f0103108:	eb 21                	jmp    f010312b <strncpy+0x36>
		*dst++ = *src;
f010310a:	8b 45 0c             	mov    0xc(%ebp),%eax
f010310d:	0f b6 10             	movzbl (%eax),%edx
f0103110:	8b 45 08             	mov    0x8(%ebp),%eax
f0103113:	88 10                	mov    %dl,(%eax)
f0103115:	83 45 08 01          	addl   $0x1,0x8(%ebp)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
f0103119:	8b 45 0c             	mov    0xc(%ebp),%eax
f010311c:	0f b6 00             	movzbl (%eax),%eax
f010311f:	84 c0                	test   %al,%al
f0103121:	74 04                	je     f0103127 <strncpy+0x32>
			src++;
f0103123:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
strncpy(char *dst, const char *src, size_t size) {
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
f0103127:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
f010312b:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010312e:	3b 45 10             	cmp    0x10(%ebp),%eax
f0103131:	72 d7                	jb     f010310a <strncpy+0x15>
		*dst++ = *src;
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
	}
	return ret;
f0103133:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0103136:	c9                   	leave  
f0103137:	c3                   	ret    

f0103138 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
f0103138:	55                   	push   %ebp
f0103139:	89 e5                	mov    %esp,%ebp
f010313b:	83 ec 10             	sub    $0x10,%esp
	char *dst_in;

	dst_in = dst;
f010313e:	8b 45 08             	mov    0x8(%ebp),%eax
f0103141:	89 45 fc             	mov    %eax,-0x4(%ebp)
	if (size > 0) {
f0103144:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103148:	74 2f                	je     f0103179 <strlcpy+0x41>
f010314a:	eb 13                	jmp    f010315f <strlcpy+0x27>
		while (--size > 0 && *src != '\0')
			*dst++ = *src++;
f010314c:	8b 45 0c             	mov    0xc(%ebp),%eax
f010314f:	0f b6 10             	movzbl (%eax),%edx
f0103152:	8b 45 08             	mov    0x8(%ebp),%eax
f0103155:	88 10                	mov    %dl,(%eax)
f0103157:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f010315b:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
{
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
		while (--size > 0 && *src != '\0')
f010315f:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f0103163:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103167:	74 0a                	je     f0103173 <strlcpy+0x3b>
f0103169:	8b 45 0c             	mov    0xc(%ebp),%eax
f010316c:	0f b6 00             	movzbl (%eax),%eax
f010316f:	84 c0                	test   %al,%al
f0103171:	75 d9                	jne    f010314c <strlcpy+0x14>
			*dst++ = *src++;
		*dst = '\0';
f0103173:	8b 45 08             	mov    0x8(%ebp),%eax
f0103176:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
f0103179:	8b 55 08             	mov    0x8(%ebp),%edx
f010317c:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010317f:	89 d1                	mov    %edx,%ecx
f0103181:	29 c1                	sub    %eax,%ecx
f0103183:	89 c8                	mov    %ecx,%eax
}
f0103185:	c9                   	leave  
f0103186:	c3                   	ret    

f0103187 <strcmp>:

int
strcmp(const char *p, const char *q)
{
f0103187:	55                   	push   %ebp
f0103188:	89 e5                	mov    %esp,%ebp
f010318a:	eb 08                	jmp    f0103194 <strcmp+0xd>
	while (*p && *p == *q)
		p++, q++;
f010318c:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f0103190:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}

int
strcmp(const char *p, const char *q)
{
	while (*p && *p == *q)
f0103194:	8b 45 08             	mov    0x8(%ebp),%eax
f0103197:	0f b6 00             	movzbl (%eax),%eax
f010319a:	84 c0                	test   %al,%al
f010319c:	74 10                	je     f01031ae <strcmp+0x27>
f010319e:	8b 45 08             	mov    0x8(%ebp),%eax
f01031a1:	0f b6 10             	movzbl (%eax),%edx
f01031a4:	8b 45 0c             	mov    0xc(%ebp),%eax
f01031a7:	0f b6 00             	movzbl (%eax),%eax
f01031aa:	38 c2                	cmp    %al,%dl
f01031ac:	74 de                	je     f010318c <strcmp+0x5>
		p++, q++;
	return (int) ((unsigned char) *p - (unsigned char) *q);
f01031ae:	8b 45 08             	mov    0x8(%ebp),%eax
f01031b1:	0f b6 00             	movzbl (%eax),%eax
f01031b4:	0f b6 d0             	movzbl %al,%edx
f01031b7:	8b 45 0c             	mov    0xc(%ebp),%eax
f01031ba:	0f b6 00             	movzbl (%eax),%eax
f01031bd:	0f b6 c0             	movzbl %al,%eax
f01031c0:	89 d1                	mov    %edx,%ecx
f01031c2:	29 c1                	sub    %eax,%ecx
f01031c4:	89 c8                	mov    %ecx,%eax
}
f01031c6:	5d                   	pop    %ebp
f01031c7:	c3                   	ret    

f01031c8 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
f01031c8:	55                   	push   %ebp
f01031c9:	89 e5                	mov    %esp,%ebp
f01031cb:	83 ec 04             	sub    $0x4,%esp
f01031ce:	eb 0c                	jmp    f01031dc <strncmp+0x14>
	while (n > 0 && *p && *p == *q)
		n--, p++, q++;
f01031d0:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f01031d4:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f01031d8:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}

int
strncmp(const char *p, const char *q, size_t n)
{
	while (n > 0 && *p && *p == *q)
f01031dc:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f01031e0:	74 1a                	je     f01031fc <strncmp+0x34>
f01031e2:	8b 45 08             	mov    0x8(%ebp),%eax
f01031e5:	0f b6 00             	movzbl (%eax),%eax
f01031e8:	84 c0                	test   %al,%al
f01031ea:	74 10                	je     f01031fc <strncmp+0x34>
f01031ec:	8b 45 08             	mov    0x8(%ebp),%eax
f01031ef:	0f b6 10             	movzbl (%eax),%edx
f01031f2:	8b 45 0c             	mov    0xc(%ebp),%eax
f01031f5:	0f b6 00             	movzbl (%eax),%eax
f01031f8:	38 c2                	cmp    %al,%dl
f01031fa:	74 d4                	je     f01031d0 <strncmp+0x8>
		n--, p++, q++;
	if (n == 0)
f01031fc:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103200:	75 09                	jne    f010320b <strncmp+0x43>
		return 0;
f0103202:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
f0103209:	eb 19                	jmp    f0103224 <strncmp+0x5c>
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
f010320b:	8b 45 08             	mov    0x8(%ebp),%eax
f010320e:	0f b6 00             	movzbl (%eax),%eax
f0103211:	0f b6 d0             	movzbl %al,%edx
f0103214:	8b 45 0c             	mov    0xc(%ebp),%eax
f0103217:	0f b6 00             	movzbl (%eax),%eax
f010321a:	0f b6 c0             	movzbl %al,%eax
f010321d:	89 d1                	mov    %edx,%ecx
f010321f:	29 c1                	sub    %eax,%ecx
f0103221:	89 4d fc             	mov    %ecx,-0x4(%ebp)
f0103224:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
f0103227:	c9                   	leave  
f0103228:	c3                   	ret    

f0103229 <strchr>:

char *
strchr(const char *s, char c)
{
f0103229:	55                   	push   %ebp
f010322a:	89 e5                	mov    %esp,%ebp
f010322c:	83 ec 08             	sub    $0x8,%esp
f010322f:	8b 45 0c             	mov    0xc(%ebp),%eax
f0103232:	88 45 fc             	mov    %al,-0x4(%ebp)
f0103235:	eb 17                	jmp    f010324e <strchr+0x25>
	for (; *s; s++)
		if (*s == c)
f0103237:	8b 45 08             	mov    0x8(%ebp),%eax
f010323a:	0f b6 00             	movzbl (%eax),%eax
f010323d:	3a 45 fc             	cmp    -0x4(%ebp),%al
f0103240:	75 08                	jne    f010324a <strchr+0x21>
			return (char *) s;
f0103242:	8b 45 08             	mov    0x8(%ebp),%eax
f0103245:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0103248:	eb 15                	jmp    f010325f <strchr+0x36>
}

char *
strchr(const char *s, char c)
{
	for (; *s; s++)
f010324a:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f010324e:	8b 45 08             	mov    0x8(%ebp),%eax
f0103251:	0f b6 00             	movzbl (%eax),%eax
f0103254:	84 c0                	test   %al,%al
f0103256:	75 df                	jne    f0103237 <strchr+0xe>
		if (*s == c)
			return (char *) s;
	return 0;
f0103258:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
f010325f:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
f0103262:	c9                   	leave  
f0103263:	c3                   	ret    

f0103264 <strfind>:

char *
strfind(const char *s, char c)
{
f0103264:	55                   	push   %ebp
f0103265:	89 e5                	mov    %esp,%ebp
f0103267:	83 ec 04             	sub    $0x4,%esp
f010326a:	8b 45 0c             	mov    0xc(%ebp),%eax
f010326d:	88 45 fc             	mov    %al,-0x4(%ebp)
f0103270:	eb 0f                	jmp    f0103281 <strfind+0x1d>
	for (; *s; s++)
		if (*s == c)
f0103272:	8b 45 08             	mov    0x8(%ebp),%eax
f0103275:	0f b6 00             	movzbl (%eax),%eax
f0103278:	3a 45 fc             	cmp    -0x4(%ebp),%al
f010327b:	74 0e                	je     f010328b <strfind+0x27>
}

char *
strfind(const char *s, char c)
{
	for (; *s; s++)
f010327d:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f0103281:	8b 45 08             	mov    0x8(%ebp),%eax
f0103284:	0f b6 00             	movzbl (%eax),%eax
f0103287:	84 c0                	test   %al,%al
f0103289:	75 e7                	jne    f0103272 <strfind+0xe>
		if (*s == c)
			break;
	return (char *) s;
f010328b:	8b 45 08             	mov    0x8(%ebp),%eax
}
f010328e:	c9                   	leave  
f010328f:	c3                   	ret    

f0103290 <memset>:


void *
memset(void *v, int c, size_t n)
{
f0103290:	55                   	push   %ebp
f0103291:	89 e5                	mov    %esp,%ebp
f0103293:	83 ec 10             	sub    $0x10,%esp
	char *p;
	int m;

	p = v;
f0103296:	8b 45 08             	mov    0x8(%ebp),%eax
f0103299:	89 45 f8             	mov    %eax,-0x8(%ebp)
	m = n;
f010329c:	8b 45 10             	mov    0x10(%ebp),%eax
f010329f:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01032a2:	eb 0e                	jmp    f01032b2 <memset+0x22>
	while (--m >= 0)
		*p++ = c;
f01032a4:	8b 45 0c             	mov    0xc(%ebp),%eax
f01032a7:	89 c2                	mov    %eax,%edx
f01032a9:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01032ac:	88 10                	mov    %dl,(%eax)
f01032ae:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
	char *p;
	int m;

	p = v;
	m = n;
	while (--m >= 0)
f01032b2:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
f01032b6:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
f01032ba:	79 e8                	jns    f01032a4 <memset+0x14>
		*p++ = c;

	return v;
f01032bc:	8b 45 08             	mov    0x8(%ebp),%eax
}
f01032bf:	c9                   	leave  
f01032c0:	c3                   	ret    

f01032c1 <memcpy>:

void *
memcpy(void *dst, const void *src, size_t n)
{
f01032c1:	55                   	push   %ebp
f01032c2:	89 e5                	mov    %esp,%ebp
f01032c4:	83 ec 10             	sub    $0x10,%esp
	const char *s;
	char *d;

	s = src;
f01032c7:	8b 45 0c             	mov    0xc(%ebp),%eax
f01032ca:	89 45 f8             	mov    %eax,-0x8(%ebp)
	d = dst;
f01032cd:	8b 45 08             	mov    0x8(%ebp),%eax
f01032d0:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01032d3:	eb 13                	jmp    f01032e8 <memcpy+0x27>
	while (n-- > 0)
		*d++ = *s++;
f01032d5:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01032d8:	0f b6 10             	movzbl (%eax),%edx
f01032db:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01032de:	88 10                	mov    %dl,(%eax)
f01032e0:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
f01032e4:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
	const char *s;
	char *d;

	s = src;
	d = dst;
	while (n-- > 0)
f01032e8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f01032ec:	0f 95 c0             	setne  %al
f01032ef:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f01032f3:	84 c0                	test   %al,%al
f01032f5:	75 de                	jne    f01032d5 <memcpy+0x14>
		*d++ = *s++;

	return dst;
f01032f7:	8b 45 08             	mov    0x8(%ebp),%eax
}
f01032fa:	c9                   	leave  
f01032fb:	c3                   	ret    

f01032fc <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
f01032fc:	55                   	push   %ebp
f01032fd:	89 e5                	mov    %esp,%ebp
f01032ff:	83 ec 10             	sub    $0x10,%esp
	const char *s;
	char *d;
	
	s = src;
f0103302:	8b 45 0c             	mov    0xc(%ebp),%eax
f0103305:	89 45 f8             	mov    %eax,-0x8(%ebp)
	d = dst;
f0103308:	8b 45 08             	mov    0x8(%ebp),%eax
f010330b:	89 45 fc             	mov    %eax,-0x4(%ebp)
	if (s < d && s + n > d) {
f010330e:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0103311:	3b 45 fc             	cmp    -0x4(%ebp),%eax
f0103314:	73 53                	jae    f0103369 <memmove+0x6d>
f0103316:	8b 45 10             	mov    0x10(%ebp),%eax
f0103319:	8b 55 f8             	mov    -0x8(%ebp),%edx
f010331c:	8d 04 02             	lea    (%edx,%eax,1),%eax
f010331f:	3b 45 fc             	cmp    -0x4(%ebp),%eax
f0103322:	76 45                	jbe    f0103369 <memmove+0x6d>
		s += n;
f0103324:	8b 45 10             	mov    0x10(%ebp),%eax
f0103327:	01 45 f8             	add    %eax,-0x8(%ebp)
		d += n;
f010332a:	8b 45 10             	mov    0x10(%ebp),%eax
f010332d:	01 45 fc             	add    %eax,-0x4(%ebp)
f0103330:	eb 13                	jmp    f0103345 <memmove+0x49>
		while (n-- > 0)
			*--d = *--s;
f0103332:	83 6d fc 01          	subl   $0x1,-0x4(%ebp)
f0103336:	83 6d f8 01          	subl   $0x1,-0x8(%ebp)
f010333a:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010333d:	0f b6 10             	movzbl (%eax),%edx
f0103340:	8b 45 fc             	mov    -0x4(%ebp),%eax
f0103343:	88 10                	mov    %dl,(%eax)
	s = src;
	d = dst;
	if (s < d && s + n > d) {
		s += n;
		d += n;
		while (n-- > 0)
f0103345:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103349:	0f 95 c0             	setne  %al
f010334c:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f0103350:	84 c0                	test   %al,%al
f0103352:	75 de                	jne    f0103332 <memmove+0x36>
f0103354:	eb 22                	jmp    f0103378 <memmove+0x7c>
			*--d = *--s;
	} else
		while (n-- > 0)
			*d++ = *s++;
f0103356:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0103359:	0f b6 10             	movzbl (%eax),%edx
f010335c:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010335f:	88 10                	mov    %dl,(%eax)
f0103361:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
f0103365:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
		s += n;
		d += n;
		while (n-- > 0)
			*--d = *--s;
	} else
		while (n-- > 0)
f0103369:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f010336d:	0f 95 c0             	setne  %al
f0103370:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f0103374:	84 c0                	test   %al,%al
f0103376:	75 de                	jne    f0103356 <memmove+0x5a>
			*d++ = *s++;

	return dst;
f0103378:	8b 45 08             	mov    0x8(%ebp),%eax
}
f010337b:	c9                   	leave  
f010337c:	c3                   	ret    

f010337d <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
f010337d:	55                   	push   %ebp
f010337e:	89 e5                	mov    %esp,%ebp
f0103380:	83 ec 14             	sub    $0x14,%esp
	const uint8_t *s1 = (const uint8_t *) v1;
f0103383:	8b 45 08             	mov    0x8(%ebp),%eax
f0103386:	89 45 f8             	mov    %eax,-0x8(%ebp)
	const uint8_t *s2 = (const uint8_t *) v2;
f0103389:	8b 45 0c             	mov    0xc(%ebp),%eax
f010338c:	89 45 fc             	mov    %eax,-0x4(%ebp)
f010338f:	eb 33                	jmp    f01033c4 <memcmp+0x47>

	while (n-- > 0) {
		if (*s1 != *s2)
f0103391:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0103394:	0f b6 10             	movzbl (%eax),%edx
f0103397:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010339a:	0f b6 00             	movzbl (%eax),%eax
f010339d:	38 c2                	cmp    %al,%dl
f010339f:	74 1b                	je     f01033bc <memcmp+0x3f>
			return (int) *s1 - (int) *s2;
f01033a1:	8b 45 f8             	mov    -0x8(%ebp),%eax
f01033a4:	0f b6 00             	movzbl (%eax),%eax
f01033a7:	0f b6 d0             	movzbl %al,%edx
f01033aa:	8b 45 fc             	mov    -0x4(%ebp),%eax
f01033ad:	0f b6 00             	movzbl (%eax),%eax
f01033b0:	0f b6 c0             	movzbl %al,%eax
f01033b3:	89 d1                	mov    %edx,%ecx
f01033b5:	29 c1                	sub    %eax,%ecx
f01033b7:	89 4d ec             	mov    %ecx,-0x14(%ebp)
f01033ba:	eb 1e                	jmp    f01033da <memcmp+0x5d>
		s1++, s2++;
f01033bc:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
f01033c0:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
memcmp(const void *v1, const void *v2, size_t n)
{
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
f01033c4:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f01033c8:	0f 95 c0             	setne  %al
f01033cb:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
f01033cf:	84 c0                	test   %al,%al
f01033d1:	75 be                	jne    f0103391 <memcmp+0x14>
		if (*s1 != *s2)
			return (int) *s1 - (int) *s2;
		s1++, s2++;
	}

	return 0;
f01033d3:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
f01033da:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f01033dd:	c9                   	leave  
f01033de:	c3                   	ret    

f01033df <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
f01033df:	55                   	push   %ebp
f01033e0:	89 e5                	mov    %esp,%ebp
f01033e2:	83 ec 10             	sub    $0x10,%esp
	const void *ends = (const char *) s + n;
f01033e5:	8b 45 10             	mov    0x10(%ebp),%eax
f01033e8:	8b 55 08             	mov    0x8(%ebp),%edx
f01033eb:	8d 04 02             	lea    (%edx,%eax,1),%eax
f01033ee:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01033f1:	eb 11                	jmp    f0103404 <memfind+0x25>
	for (; s < ends; s++)
		if (*(const unsigned char *) s == (unsigned char) c)
f01033f3:	8b 45 08             	mov    0x8(%ebp),%eax
f01033f6:	0f b6 10             	movzbl (%eax),%edx
f01033f9:	8b 45 0c             	mov    0xc(%ebp),%eax
f01033fc:	38 c2                	cmp    %al,%dl
f01033fe:	74 0c                	je     f010340c <memfind+0x2d>

void *
memfind(const void *s, int c, size_t n)
{
	const void *ends = (const char *) s + n;
	for (; s < ends; s++)
f0103400:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f0103404:	8b 45 08             	mov    0x8(%ebp),%eax
f0103407:	3b 45 fc             	cmp    -0x4(%ebp),%eax
f010340a:	72 e7                	jb     f01033f3 <memfind+0x14>
		if (*(const unsigned char *) s == (unsigned char) c)
			break;
	return (void *) s;
f010340c:	8b 45 08             	mov    0x8(%ebp),%eax
}
f010340f:	c9                   	leave  
f0103410:	c3                   	ret    

f0103411 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
f0103411:	55                   	push   %ebp
f0103412:	89 e5                	mov    %esp,%ebp
f0103414:	83 ec 14             	sub    $0x14,%esp
	int neg = 0;
f0103417:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
	long val = 0;
f010341e:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
f0103425:	eb 04                	jmp    f010342b <strtol+0x1a>

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
		s++;
f0103427:	83 45 08 01          	addl   $0x1,0x8(%ebp)
{
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
f010342b:	8b 45 08             	mov    0x8(%ebp),%eax
f010342e:	0f b6 00             	movzbl (%eax),%eax
f0103431:	3c 20                	cmp    $0x20,%al
f0103433:	74 f2                	je     f0103427 <strtol+0x16>
f0103435:	8b 45 08             	mov    0x8(%ebp),%eax
f0103438:	0f b6 00             	movzbl (%eax),%eax
f010343b:	3c 09                	cmp    $0x9,%al
f010343d:	74 e8                	je     f0103427 <strtol+0x16>
		s++;

	// plus/minus sign
	if (*s == '+')
f010343f:	8b 45 08             	mov    0x8(%ebp),%eax
f0103442:	0f b6 00             	movzbl (%eax),%eax
f0103445:	3c 2b                	cmp    $0x2b,%al
f0103447:	75 06                	jne    f010344f <strtol+0x3e>
		s++;
f0103449:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f010344d:	eb 15                	jmp    f0103464 <strtol+0x53>
	else if (*s == '-')
f010344f:	8b 45 08             	mov    0x8(%ebp),%eax
f0103452:	0f b6 00             	movzbl (%eax),%eax
f0103455:	3c 2d                	cmp    $0x2d,%al
f0103457:	75 0b                	jne    f0103464 <strtol+0x53>
		s++, neg = 1;
f0103459:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f010345d:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
f0103464:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103468:	74 06                	je     f0103470 <strtol+0x5f>
f010346a:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
f010346e:	75 24                	jne    f0103494 <strtol+0x83>
f0103470:	8b 45 08             	mov    0x8(%ebp),%eax
f0103473:	0f b6 00             	movzbl (%eax),%eax
f0103476:	3c 30                	cmp    $0x30,%al
f0103478:	75 1a                	jne    f0103494 <strtol+0x83>
f010347a:	8b 45 08             	mov    0x8(%ebp),%eax
f010347d:	83 c0 01             	add    $0x1,%eax
f0103480:	0f b6 00             	movzbl (%eax),%eax
f0103483:	3c 78                	cmp    $0x78,%al
f0103485:	75 0d                	jne    f0103494 <strtol+0x83>
		s += 2, base = 16;
f0103487:	83 45 08 02          	addl   $0x2,0x8(%ebp)
f010348b:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
f0103492:	eb 2a                	jmp    f01034be <strtol+0xad>
	else if (base == 0 && s[0] == '0')
f0103494:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f0103498:	75 17                	jne    f01034b1 <strtol+0xa0>
f010349a:	8b 45 08             	mov    0x8(%ebp),%eax
f010349d:	0f b6 00             	movzbl (%eax),%eax
f01034a0:	3c 30                	cmp    $0x30,%al
f01034a2:	75 0d                	jne    f01034b1 <strtol+0xa0>
		s++, base = 8;
f01034a4:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f01034a8:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
f01034af:	eb 0d                	jmp    f01034be <strtol+0xad>
	else if (base == 0)
f01034b1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
f01034b5:	75 07                	jne    f01034be <strtol+0xad>
		base = 10;
f01034b7:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
f01034be:	8b 45 08             	mov    0x8(%ebp),%eax
f01034c1:	0f b6 00             	movzbl (%eax),%eax
f01034c4:	3c 2f                	cmp    $0x2f,%al
f01034c6:	7e 1b                	jle    f01034e3 <strtol+0xd2>
f01034c8:	8b 45 08             	mov    0x8(%ebp),%eax
f01034cb:	0f b6 00             	movzbl (%eax),%eax
f01034ce:	3c 39                	cmp    $0x39,%al
f01034d0:	7f 11                	jg     f01034e3 <strtol+0xd2>
			dig = *s - '0';
f01034d2:	8b 45 08             	mov    0x8(%ebp),%eax
f01034d5:	0f b6 00             	movzbl (%eax),%eax
f01034d8:	0f be c0             	movsbl %al,%eax
f01034db:	83 e8 30             	sub    $0x30,%eax
f01034de:	89 45 fc             	mov    %eax,-0x4(%ebp)
f01034e1:	eb 48                	jmp    f010352b <strtol+0x11a>
		else if (*s >= 'a' && *s <= 'z')
f01034e3:	8b 45 08             	mov    0x8(%ebp),%eax
f01034e6:	0f b6 00             	movzbl (%eax),%eax
f01034e9:	3c 60                	cmp    $0x60,%al
f01034eb:	7e 1b                	jle    f0103508 <strtol+0xf7>
f01034ed:	8b 45 08             	mov    0x8(%ebp),%eax
f01034f0:	0f b6 00             	movzbl (%eax),%eax
f01034f3:	3c 7a                	cmp    $0x7a,%al
f01034f5:	7f 11                	jg     f0103508 <strtol+0xf7>
			dig = *s - 'a' + 10;
f01034f7:	8b 45 08             	mov    0x8(%ebp),%eax
f01034fa:	0f b6 00             	movzbl (%eax),%eax
f01034fd:	0f be c0             	movsbl %al,%eax
f0103500:	83 e8 57             	sub    $0x57,%eax
f0103503:	89 45 fc             	mov    %eax,-0x4(%ebp)
f0103506:	eb 23                	jmp    f010352b <strtol+0x11a>
		else if (*s >= 'A' && *s <= 'Z')
f0103508:	8b 45 08             	mov    0x8(%ebp),%eax
f010350b:	0f b6 00             	movzbl (%eax),%eax
f010350e:	3c 40                	cmp    $0x40,%al
f0103510:	7e 37                	jle    f0103549 <strtol+0x138>
f0103512:	8b 45 08             	mov    0x8(%ebp),%eax
f0103515:	0f b6 00             	movzbl (%eax),%eax
f0103518:	3c 5a                	cmp    $0x5a,%al
f010351a:	7f 2d                	jg     f0103549 <strtol+0x138>
			dig = *s - 'A' + 10;
f010351c:	8b 45 08             	mov    0x8(%ebp),%eax
f010351f:	0f b6 00             	movzbl (%eax),%eax
f0103522:	0f be c0             	movsbl %al,%eax
f0103525:	83 e8 37             	sub    $0x37,%eax
f0103528:	89 45 fc             	mov    %eax,-0x4(%ebp)
		else
			break;
		if (dig >= base)
f010352b:	8b 45 fc             	mov    -0x4(%ebp),%eax
f010352e:	3b 45 10             	cmp    0x10(%ebp),%eax
f0103531:	7d 16                	jge    f0103549 <strtol+0x138>
			break;
		s++, val = (val * base) + dig;
f0103533:	83 45 08 01          	addl   $0x1,0x8(%ebp)
f0103537:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010353a:	0f af 45 10          	imul   0x10(%ebp),%eax
f010353e:	03 45 fc             	add    -0x4(%ebp),%eax
f0103541:	89 45 f8             	mov    %eax,-0x8(%ebp)
f0103544:	e9 75 ff ff ff       	jmp    f01034be <strtol+0xad>
		// we don't properly detect overflow!
	}

	if (endptr)
f0103549:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
f010354d:	74 08                	je     f0103557 <strtol+0x146>
		*endptr = (char *) s;
f010354f:	8b 55 08             	mov    0x8(%ebp),%edx
f0103552:	8b 45 0c             	mov    0xc(%ebp),%eax
f0103555:	89 10                	mov    %edx,(%eax)
	return (neg ? -val : val);
f0103557:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
f010355b:	74 0c                	je     f0103569 <strtol+0x158>
f010355d:	8b 45 f8             	mov    -0x8(%ebp),%eax
f0103560:	89 c2                	mov    %eax,%edx
f0103562:	f7 da                	neg    %edx
f0103564:	89 55 ec             	mov    %edx,-0x14(%ebp)
f0103567:	eb 06                	jmp    f010356f <strtol+0x15e>
f0103569:	8b 45 f8             	mov    -0x8(%ebp),%eax
f010356c:	89 45 ec             	mov    %eax,-0x14(%ebp)
f010356f:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
f0103572:	c9                   	leave  
f0103573:	c3                   	ret    
	...

f0103580 <__udivdi3>:
f0103580:	83 ec 24             	sub    $0x24,%esp
f0103583:	8b 44 24 30          	mov    0x30(%esp),%eax
f0103587:	89 74 24 18          	mov    %esi,0x18(%esp)
f010358b:	8b 54 24 2c          	mov    0x2c(%esp),%edx
f010358f:	89 7c 24 1c          	mov    %edi,0x1c(%esp)
f0103593:	8b 7c 24 28          	mov    0x28(%esp),%edi
f0103597:	89 6c 24 20          	mov    %ebp,0x20(%esp)
f010359b:	89 c6                	mov    %eax,%esi
f010359d:	8b 44 24 34          	mov    0x34(%esp),%eax
f01035a1:	89 14 24             	mov    %edx,(%esp)
f01035a4:	85 c0                	test   %eax,%eax
f01035a6:	75 30                	jne    f01035d8 <__udivdi3+0x58>
f01035a8:	39 d6                	cmp    %edx,%esi
f01035aa:	77 4c                	ja     f01035f8 <__udivdi3+0x78>
f01035ac:	85 f6                	test   %esi,%esi
f01035ae:	75 0d                	jne    f01035bd <__udivdi3+0x3d>
f01035b0:	b9 01 00 00 00       	mov    $0x1,%ecx
f01035b5:	31 d2                	xor    %edx,%edx
f01035b7:	89 c8                	mov    %ecx,%eax
f01035b9:	f7 f6                	div    %esi
f01035bb:	89 c6                	mov    %eax,%esi
f01035bd:	8b 2c 24             	mov    (%esp),%ebp
f01035c0:	31 d2                	xor    %edx,%edx
f01035c2:	89 e8                	mov    %ebp,%eax
f01035c4:	f7 f6                	div    %esi
f01035c6:	89 c5                	mov    %eax,%ebp
f01035c8:	89 f8                	mov    %edi,%eax
f01035ca:	f7 f6                	div    %esi
f01035cc:	89 ee                	mov    %ebp,%esi
f01035ce:	89 c1                	mov    %eax,%ecx
f01035d0:	eb 0f                	jmp    f01035e1 <__udivdi3+0x61>
f01035d2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
f01035d8:	3b 04 24             	cmp    (%esp),%eax
f01035db:	76 2b                	jbe    f0103608 <__udivdi3+0x88>
f01035dd:	31 c9                	xor    %ecx,%ecx
f01035df:	31 f6                	xor    %esi,%esi
f01035e1:	89 c8                	mov    %ecx,%eax
f01035e3:	89 f2                	mov    %esi,%edx
f01035e5:	8b 74 24 18          	mov    0x18(%esp),%esi
f01035e9:	8b 7c 24 1c          	mov    0x1c(%esp),%edi
f01035ed:	8b 6c 24 20          	mov    0x20(%esp),%ebp
f01035f1:	83 c4 24             	add    $0x24,%esp
f01035f4:	c3                   	ret    
f01035f5:	8d 76 00             	lea    0x0(%esi),%esi
f01035f8:	89 f8                	mov    %edi,%eax
f01035fa:	f7 f6                	div    %esi
f01035fc:	31 f6                	xor    %esi,%esi
f01035fe:	89 c1                	mov    %eax,%ecx
f0103600:	eb df                	jmp    f01035e1 <__udivdi3+0x61>
f0103602:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
f0103608:	0f bd e8             	bsr    %eax,%ebp
f010360b:	83 f5 1f             	xor    $0x1f,%ebp
f010360e:	75 20                	jne    f0103630 <__udivdi3+0xb0>
f0103610:	3b 04 24             	cmp    (%esp),%eax
f0103613:	72 05                	jb     f010361a <__udivdi3+0x9a>
f0103615:	39 fe                	cmp    %edi,%esi
f0103617:	90                   	nop    
f0103618:	77 c3                	ja     f01035dd <__udivdi3+0x5d>
f010361a:	b9 01 00 00 00       	mov    $0x1,%ecx
f010361f:	31 f6                	xor    %esi,%esi
f0103621:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
f0103628:	eb b7                	jmp    f01035e1 <__udivdi3+0x61>
f010362a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
f0103630:	89 e9                	mov    %ebp,%ecx
f0103632:	89 f2                	mov    %esi,%edx
f0103634:	d3 e0                	shl    %cl,%eax
f0103636:	b9 20 00 00 00       	mov    $0x20,%ecx
f010363b:	29 e9                	sub    %ebp,%ecx
f010363d:	89 4c 24 04          	mov    %ecx,0x4(%esp)
f0103641:	d3 ea                	shr    %cl,%edx
f0103643:	89 e9                	mov    %ebp,%ecx
f0103645:	d3 e6                	shl    %cl,%esi
f0103647:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
f010364c:	09 d0                	or     %edx,%eax
f010364e:	89 74 24 14          	mov    %esi,0x14(%esp)
f0103652:	8b 34 24             	mov    (%esp),%esi
f0103655:	8b 14 24             	mov    (%esp),%edx
f0103658:	89 44 24 10          	mov    %eax,0x10(%esp)
f010365c:	89 f8                	mov    %edi,%eax
f010365e:	d3 ee                	shr    %cl,%esi
f0103660:	89 e9                	mov    %ebp,%ecx
f0103662:	d3 e2                	shl    %cl,%edx
f0103664:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
f0103669:	d3 e8                	shr    %cl,%eax
f010366b:	09 d0                	or     %edx,%eax
f010366d:	89 f2                	mov    %esi,%edx
f010366f:	f7 74 24 10          	divl   0x10(%esp)
f0103673:	89 d6                	mov    %edx,%esi
f0103675:	89 44 24 04          	mov    %eax,0x4(%esp)
f0103679:	8b 44 24 14          	mov    0x14(%esp),%eax
f010367d:	f7 64 24 04          	mull   0x4(%esp)
f0103681:	39 d6                	cmp    %edx,%esi
f0103683:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0103687:	72 1f                	jb     f01036a8 <__udivdi3+0x128>
f0103689:	74 0d                	je     f0103698 <__udivdi3+0x118>
f010368b:	8b 4c 24 04          	mov    0x4(%esp),%ecx
f010368f:	31 f6                	xor    %esi,%esi
f0103691:	e9 4b ff ff ff       	jmp    f01035e1 <__udivdi3+0x61>
f0103696:	66 90                	xchg   %ax,%ax
f0103698:	89 f8                	mov    %edi,%eax
f010369a:	89 e9                	mov    %ebp,%ecx
f010369c:	d3 e0                	shl    %cl,%eax
f010369e:	3b 44 24 0c          	cmp    0xc(%esp),%eax
f01036a2:	73 e7                	jae    f010368b <__udivdi3+0x10b>
f01036a4:	8d 74 26 00          	lea    0x0(%esi),%esi
f01036a8:	8b 4c 24 04          	mov    0x4(%esp),%ecx
f01036ac:	31 f6                	xor    %esi,%esi
f01036ae:	83 e9 01             	sub    $0x1,%ecx
f01036b1:	e9 2b ff ff ff       	jmp    f01035e1 <__udivdi3+0x61>
	...

f01036c0 <__umoddi3>:
f01036c0:	83 ec 2c             	sub    $0x2c,%esp
f01036c3:	8b 44 24 38          	mov    0x38(%esp),%eax
f01036c7:	89 7c 24 24          	mov    %edi,0x24(%esp)
f01036cb:	8b 4c 24 30          	mov    0x30(%esp),%ecx
f01036cf:	89 74 24 20          	mov    %esi,0x20(%esp)
f01036d3:	8b 74 24 34          	mov    0x34(%esp),%esi
f01036d7:	89 6c 24 28          	mov    %ebp,0x28(%esp)
f01036db:	89 c7                	mov    %eax,%edi
f01036dd:	8b 44 24 3c          	mov    0x3c(%esp),%eax
f01036e1:	89 4c 24 10          	mov    %ecx,0x10(%esp)
f01036e5:	89 4c 24 14          	mov    %ecx,0x14(%esp)
f01036e9:	85 c0                	test   %eax,%eax
f01036eb:	75 23                	jne    f0103710 <__umoddi3+0x50>
f01036ed:	39 f7                	cmp    %esi,%edi
f01036ef:	76 37                	jbe    f0103728 <__umoddi3+0x68>
f01036f1:	89 c8                	mov    %ecx,%eax
f01036f3:	89 f2                	mov    %esi,%edx
f01036f5:	f7 f7                	div    %edi
f01036f7:	89 d0                	mov    %edx,%eax
f01036f9:	31 d2                	xor    %edx,%edx
f01036fb:	8b 74 24 20          	mov    0x20(%esp),%esi
f01036ff:	8b 7c 24 24          	mov    0x24(%esp),%edi
f0103703:	8b 6c 24 28          	mov    0x28(%esp),%ebp
f0103707:	83 c4 2c             	add    $0x2c,%esp
f010370a:	c3                   	ret    
f010370b:	90                   	nop    
f010370c:	8d 74 26 00          	lea    0x0(%esi),%esi
f0103710:	39 f0                	cmp    %esi,%eax
f0103712:	76 34                	jbe    f0103748 <__umoddi3+0x88>
f0103714:	89 c8                	mov    %ecx,%eax
f0103716:	89 f2                	mov    %esi,%edx
f0103718:	8b 74 24 20          	mov    0x20(%esp),%esi
f010371c:	8b 7c 24 24          	mov    0x24(%esp),%edi
f0103720:	8b 6c 24 28          	mov    0x28(%esp),%ebp
f0103724:	83 c4 2c             	add    $0x2c,%esp
f0103727:	c3                   	ret    
f0103728:	85 ff                	test   %edi,%edi
f010372a:	75 0b                	jne    f0103737 <__umoddi3+0x77>
f010372c:	b8 01 00 00 00       	mov    $0x1,%eax
f0103731:	31 d2                	xor    %edx,%edx
f0103733:	f7 f7                	div    %edi
f0103735:	89 c7                	mov    %eax,%edi
f0103737:	89 f0                	mov    %esi,%eax
f0103739:	31 d2                	xor    %edx,%edx
f010373b:	f7 f7                	div    %edi
f010373d:	8b 44 24 14          	mov    0x14(%esp),%eax
f0103741:	f7 f7                	div    %edi
f0103743:	eb b2                	jmp    f01036f7 <__umoddi3+0x37>
f0103745:	8d 76 00             	lea    0x0(%esi),%esi
f0103748:	0f bd e8             	bsr    %eax,%ebp
f010374b:	83 f5 1f             	xor    $0x1f,%ebp
f010374e:	75 20                	jne    f0103770 <__umoddi3+0xb0>
f0103750:	39 f0                	cmp    %esi,%eax
f0103752:	0f 83 b8 00 00 00    	jae    f0103810 <__umoddi3+0x150>
f0103758:	8b 54 24 14          	mov    0x14(%esp),%edx
f010375c:	29 fa                	sub    %edi,%edx
f010375e:	19 c6                	sbb    %eax,%esi
f0103760:	89 54 24 14          	mov    %edx,0x14(%esp)
f0103764:	8b 44 24 14          	mov    0x14(%esp),%eax
f0103768:	89 f2                	mov    %esi,%edx
f010376a:	eb ac                	jmp    f0103718 <__umoddi3+0x58>
f010376c:	8d 74 26 00          	lea    0x0(%esi),%esi
f0103770:	89 c2                	mov    %eax,%edx
f0103772:	b8 20 00 00 00       	mov    $0x20,%eax
f0103777:	29 e8                	sub    %ebp,%eax
f0103779:	89 e9                	mov    %ebp,%ecx
f010377b:	d3 e2                	shl    %cl,%edx
f010377d:	89 44 24 0c          	mov    %eax,0xc(%esp)
f0103781:	0f b6 4c 24 0c       	movzbl 0xc(%esp),%ecx
f0103786:	89 f8                	mov    %edi,%eax
f0103788:	d3 e8                	shr    %cl,%eax
f010378a:	89 e9                	mov    %ebp,%ecx
f010378c:	d3 e7                	shl    %cl,%edi
f010378e:	0f b6 4c 24 0c       	movzbl 0xc(%esp),%ecx
f0103793:	09 d0                	or     %edx,%eax
f0103795:	89 44 24 18          	mov    %eax,0x18(%esp)
f0103799:	89 f0                	mov    %esi,%eax
f010379b:	89 f2                	mov    %esi,%edx
f010379d:	89 7c 24 1c          	mov    %edi,0x1c(%esp)
f01037a1:	8b 7c 24 10          	mov    0x10(%esp),%edi
f01037a5:	d3 e8                	shr    %cl,%eax
f01037a7:	89 e9                	mov    %ebp,%ecx
f01037a9:	d3 e2                	shl    %cl,%edx
f01037ab:	0f b6 4c 24 0c       	movzbl 0xc(%esp),%ecx
f01037b0:	89 44 24 04          	mov    %eax,0x4(%esp)
f01037b4:	8b 44 24 10          	mov    0x10(%esp),%eax
f01037b8:	8b 74 24 04          	mov    0x4(%esp),%esi
f01037bc:	d3 e8                	shr    %cl,%eax
f01037be:	89 e9                	mov    %ebp,%ecx
f01037c0:	09 d0                	or     %edx,%eax
f01037c2:	89 f2                	mov    %esi,%edx
f01037c4:	f7 74 24 18          	divl   0x18(%esp)
f01037c8:	89 d6                	mov    %edx,%esi
f01037ca:	d3 e7                	shl    %cl,%edi
f01037cc:	f7 64 24 1c          	mull   0x1c(%esp)
f01037d0:	39 d6                	cmp    %edx,%esi
f01037d2:	73 2c                	jae    f0103800 <__umoddi3+0x140>
f01037d4:	2b 44 24 1c          	sub    0x1c(%esp),%eax
f01037d8:	1b 54 24 18          	sbb    0x18(%esp),%edx
f01037dc:	29 c7                	sub    %eax,%edi
f01037de:	19 d6                	sbb    %edx,%esi
f01037e0:	89 e9                	mov    %ebp,%ecx
f01037e2:	89 fa                	mov    %edi,%edx
f01037e4:	d3 ea                	shr    %cl,%edx
f01037e6:	0f b6 4c 24 0c       	movzbl 0xc(%esp),%ecx
f01037eb:	89 f0                	mov    %esi,%eax
f01037ed:	d3 e0                	shl    %cl,%eax
f01037ef:	89 e9                	mov    %ebp,%ecx
f01037f1:	09 d0                	or     %edx,%eax
f01037f3:	89 f2                	mov    %esi,%edx
f01037f5:	d3 ea                	shr    %cl,%edx
f01037f7:	e9 1c ff ff ff       	jmp    f0103718 <__umoddi3+0x58>
f01037fc:	8d 74 26 00          	lea    0x0(%esi),%esi
f0103800:	75 da                	jne    f01037dc <__umoddi3+0x11c>
f0103802:	39 c7                	cmp    %eax,%edi
f0103804:	73 d6                	jae    f01037dc <__umoddi3+0x11c>
f0103806:	66 90                	xchg   %ax,%ax
f0103808:	eb ca                	jmp    f01037d4 <__umoddi3+0x114>
f010380a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
f0103810:	3b 7c 24 14          	cmp    0x14(%esp),%edi
f0103814:	8d 74 26 00          	lea    0x0(%esi),%esi
f0103818:	0f 87 46 ff ff ff    	ja     f0103764 <__umoddi3+0xa4>
f010381e:	66 90                	xchg   %ax,%ax
f0103820:	e9 33 ff ff ff       	jmp    f0103758 <__umoddi3+0x98>
